This article is half-done without your Comment! *** Please share your thoughts via Comment ***
SQL Server 2012 introduced a feature like Contained Database which stores all the metadata information of your database in itself; it is not storing into a master database.
If you defined your database as contained database, it is isolated from the other database. Whenever you need to move your database from one instance to another instance, a contained database is the best option because you do not require to migrate information like Database users separately.
Before creating an any contained database, you must enable it at an instance level. You can create a user to access the Contained Database.
In the next post, I will share T-SQL script to enable contained database at instance level so DBA can access this post in SQL Server DBA category.
Using SSMS, You can also create a contained database like right click on database -> New Database… -> Option -> Containment type -> Partial
T-SQL Script to create a contained database:
1 2 3 |
CREATE DATABASE db_name CONTAINMENT = PARTIAL GO |
Leave a Reply