Since the Syntax section of the CREATE USER
doc doesn't include the CHECK_POLICY
option, I assume it's not a possibility for the CREATE USER
command.
It seems the only way to achieve it is a workaround. You should create a normal SQL Server login with CHECK_POLICY = OFF
and migrate it with sp_migrate_user_to_contained.
CREATE DATABASE Test;
GO
EXECUTE sp_configure 'contained database authentication', 1;
RECONFIGURE;
GO
ALTER DATABASE Test
SET RESTRICTED_USER
WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE Test
SET containment=partial;
GO
ALTER DATABASE Test
SET MULTI_USER;
GO
USE Test;
GO
CREATE LOGIN userWeakPWD
WITH PASSWORD='pwd', CHECK_POLICY = OFF;
GO
CREATE USER userWeakPWD
FOR LOGIN userWeakPWD;
GO
EXEC sp_migrate_user_to_contained
@username = N'userWeakPWD',
@rename = N'keep_name',
@disablelogin = N'disable_login';
GO
I couldn't find any doc from Microsoft stating the existing restriction for creating a new contained user with CHECK_POLICY = OFF
, but I had no lucky finding one explaining officially how to achieve it too.
Source: CHECK_POLICY = OFF Contained CREATE USER Statement (Credits to Shulei Chen)