[dba-SQLServer] Login names vs users

Haslett, Andrew andrew.haslett at ilc.gov.au
Tue Nov 2 23:13:06 CST 2004


Sp_AddLogin  - creates a SQL Login (User) - You can then connect to an
instance via SQL Authentication using this login.

Sp_AddUser (or sp_grantdbaccess in SQL 2K) - allows an existing SQL User
access to the current database.

Sp_AddGroup (of sp_AddRole in SQL 2K) - creates a new role in the current
database.

Workflow wise, you would first create the login (sp_addlogin), and then
grant access for that login to a specific database (sp_grantdbaccess).

If you wish, you can create a specific role in that database (sp_AddRole),
add your user (or many users) to this role (sp_addrolemember), and give the
required privileges to that role, instead of individual users.  Similar to
creating groups in active directory and adding users to those groups.

Mind you, you can do all this through the GUI in Enterprise Manager..

Cheers,
A


-----Original Message-----
From: John W. Colby [mailto:jwcolby at colbyconsulting.com] 
Sent: Wednesday, 3 November 2004 3:13 PM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] Login names vs users

What is the relationship between login names and users, groups and roles?

SP_AddLogin
SP_AddUser
Sp_AddGroup
Sp_AddRole


John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

IMPORTANT - PLEASE READ ******************** 
This email and any files transmitted with it are confidential and may 
contain information protected by law from disclosure. 
If you have received this message in error, please notify the sender 
immediately and delete this email from your system. 
No warranty is given that this email or files, if attached to this 
email, are free from computer viruses or other defects. They 
are provided on the basis the user assumes all responsibility for 
loss, damage or consequence resulting directly or indirectly from 
their use, whether caused by the negligence of the sender or not.



More information about the dba-SQLServer mailing list