Click here to read “How to Configure a Contained Database Feature in SQL Server” article from the beginning.
How to Create a SQL Server or Windows Login which will have access to the Contained Database
A contained database can be accessed by a SQL Server or a Windows Login. This login should be created within the Contained Database.
Step 1. To create a login Expand Databases …. Expand ContainedDatabaseSQL2012…. Expand Security …. Right click Users and select New User… from the drop down menu as shown in the snippet below.

Step 2. To create a New Database User, enter User Name, enter Password, Confirm Password and enter Default schema as “dbo” as shown in the snippet below and click OK.

How to Create New SQL Server User Using T-SQL code
USE [ContainedDatabaseSQL2012]
GO
CREATE USER [ContainedDatabaseLogin]
WITH PASSWORD=N'Str0ngP@$$', DEFAULT_SCHEMA = [dbo]
GO
Click the below Number Buttons to continue reading the rest of the article.
Add comment