Creating an authenticated user sign-in
- Start one of the Microsoft applications previously mentioned . Ensure that you sign in as a system administrator.
-
Specify these lines. You can specify all the lines and then run
them collectively.
Non-administrative user: use master go sp_grantlogin '<domain>\<username>' go use <database> go EXEC sp_grantdbaccess '<domain>\<username>' go
Where:
-
<domain>
is the name of the domain where the database resides. -
<username>
is the name with which the user signs in to the network. -
<database>
is the name of the database.
For example, to create a user Scott with a sign-in of Scott and a password of password on database CTRAIN, you must specify:use master go sp_grantlogin 'Corporate\Scott' go use CTRAIN go EXEC sp_grantdbaccess 'Corporate\Scott' go
To create an Administrative user:
use master go sp_grantlogin '<domain>\<username>' go use <database> go EXEC sp_grantdbaccess '<domain>\<username>' go use <database>_A go EXEC sp_grantdbaccess '<domain>\<username>'
Where:
-
<domain>
is the name of the domain where the database resides. -
<username>
is the name with which the user signs in to the network. The sign-in name must exactly match the username. -
<database>
is the name of the production database. -
<database>_A
is the name of the authorized database.
For example, to create an administrative user Scott signing in to the domain Corporate and using the database CTRAIN, you must specify:
use master go sp_grantlogin 'Corporate\Scott' go use CTRAIN go EXEC sp_grantdbaccess 'Corporate\Scott' go use CTRAIN_A go EXEC sp_grantdbaccess 'Corporate\Scott'
-
- Run the query.
-
Verify that the commands were run successfully.
Existing users can be upgraded to have authenticated sign-ins, if required. To upgrade an existing user, re-add the user as a new user, following the preceding procedure.