MS SQL Server 2012 - DBA Articles

CREATE DATABASE User to connect Database



This article describes how to create a database user mapped to a login in SQL Server 2012 by using SQL Server Management Studio. The database user is the identity of the login when it is connected to a database. The database user can use the same name as the login, but that is not required. This topic assumes that a login already exists in SQL Server.

For this demonstration, CREATE Inventory_Database user-defined database.



Type Inventory_Database in the Database Name Text Box.



Click OK and then refresh Databases option in the left Object Explorer Window.






In Object Explorer, expand the Databases folder.

Expand the database in which to create the new database user.



Expand the Security and Right-click the Users and then click New User....



In the Database User - New dialog box, on the General page, select one of the following user types from the User type list: SQL user with login, SQL user without login, User mapped to a certificate, User mapped to an asymmetric key, or Windows user.



Select Windows user option.



In the User name box, enter a name for the new user. If you have chosen Windows user from the User type list, you can also click the ellipsis (...) to open the Select User or Group dialog box.

In the Login name box, enter the login for the user. Alternately, click the ellipsis (...) to open the Select Login dialog box. Login name is available if you select either SQL user with login or Windows user from the User type list.

In the Default schema box, specifies the schema that will own objects created by this user. Alternately, click the ellipsis (...) to open the Select Schema dialog box. Default schema is available if you select either SQL user with login, SQL user without login, or Windows user from the User type list.



Select default schema [dbo] from the Matching objects.



Click OK.



Additional Options

The Database User - New dialog box also offers options on four additional pages: Owned Schemas, Membership, Securables, and Extended Properties.

Note: Securables and Extended Properties will discuss in the other articles.

The Owned Schemas page lists all possible schemas that can be owned by the new database user. To add schemas to or remove them from a database user, under Schemas owned by this user, select or clear the check boxes next to the schemas.



The Membership page lists all possible database membership roles that can be owned by the new database user. To add roles to or remove them from a database user, under Database role membership, select or clear the check boxes next to the roles.



Select db_owner check box.



Click OK and then refresh Users option in the Object Explorer Window.






More Reference URL: http://msdn.microsoft.com/en-us/library/aa337545%28v=sql.110%29.aspx

* * * * *


Email Your Comment To AUTHOR