SQL Server – The sp_configure value ‘contained database authentication’ must be set to 1 in order to create a contained database. – Error 12824

Contained Databases feature is introduced in SQL Server 2012.

If you want to create or attach a contained database to the SQL Server instance, you must enable the 'contained database authentication' first.

Without 'contained database authentication' option enabled, you will get the following error:

contained_database_create_error

Msg 12824, Level 16, State 1, Line 1
The sp_configure value 'contained database authentication' must be set to 1 in order to create a contained database.
You may need to use RECONFIGURE to set the value_in_use.

To enable 'contained database authentication' option, run this code:

EXEC sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO