SQL Server 2012 Features:4: Contained Database

In continuation of previous blog:

Contained Databases:

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.

Containment Settings:

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!


About Mirza Husain

Mirza Husain is a senior consultant-database and having more than 10+ years of experience in the IT industry with different domains. He is fond of writing and speaking about SQL Server and also keen to learn new technologies. He is holding MCA degree and having Microsoft certifications as MCP & MCTS. He is also ITIL certified. In his past years, he worked with many clients as Microsoft, Bank of America etc. Currently he is associated with a France based client and offering his best services. You may reach him on his email id -- mirza_dba@outlook.com. Thanks!
This entry was posted in Database Administration, Sql Server New Feature. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s