–To create or enable a contained database, you must first enable this feature on the SQL instance:
SP_CONFIGURE ‘contained database authentication’, 1
GO
RECONFIGURE
GO
–Create your database:
USE master
Go
CREATE DATABASE ContainDB
GO
–Change database type to contained:
USE master
GO
ALTER DATABASE ContainDB
SET CONTAINMENT = PARTIAL