In continuation of previous blog:
A contained database includes all database settings and the metadata within itself which results no configuration dependencies on the instance of SQL Server. Therefore a contained database is a database that is isolated from other databases and from the instance of SQL Server that hosts the database.
The containment setting of a database can be NONE, PARTIAL or FULL. But only NONE and PARTIAL are supported on SQL Server 2012.
We need to make changes on the server level followed by database level.
Server Level Settings:
Go to SSMS–> Right click on Server name–> Properties–>Advanced–> Containment–>choose True
Database level Settings:
Now to change the settings on the database which you want to be a contained database, we can do it for existing as well as with new database for the required server edition.
When a database is created the “Containment type” should be set to “partial” to make the database a contained database, as shown below.
Here we need to choose the partial option for containment type.
After that we have to create a user under the contained database and check the login for that user as below. Here user is created with name Mirza and we are checking by connecting it.
Here we have to mention the database which is contained and then connect it by using user.
Note: Initially I promise to provide only brief summary however few features are interesting and they can’t be bound in one line definition. This blog is such an example.
Looking forward your likes and response!