Creating a Contained Database

Two key steps are required to create partially contained database in SQL Server 2012. The first step is to enable contained database authentication. Contained database authentication is enabled or disabled for the entire SQL Server instance. This can be done using SSMS or via T-SQL. In SSMS, right-click on the server name in Object Explorer and click Properties. On the Advanced tab, set the Enable Contained Databases option to True, as shown in Figure 19.9.

Image

FIGURE 19.9 Enabling contained database authentication.

The following T-SQL statements can also be used to enable contained database authentication:

Get Microsoft® SQL Server 2012 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.