December 2013
Intermediate to advanced
1872 pages
153h 31m
English
CREATE USER, ALTER USER, and DROP USER are the T-SQL commands you use most often to manage database users. These commands are replacements for the system stored procedures used in prior versions. The system stored procedures, such as sp_adduser, sp_dropuser, sp_grantdbaccess, and sp_revokedbaccess, have been deprecated and will be removed in a future version. They are still available for use now, but you should avoid them when possible.
The following example demonstrates the use of the CREATE USER statement to create a new database user named Laura, with a default schema Sales:
CREATE USER Laura FOR LOGIN Laura WITH DEFAULT_SCHEMA = Sales
You can use the ALTER USER statement to change ...