Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 login and user

Author  Topic 

shanilash
Starting Member

17 Posts

Posted - 2009-05-20 : 08:40:27
i want to know the difference between login and users...

if a request came, "provide access to the database ABC of the server XYZ" what should i do...will i have to create a new user or a new login and granting access to the particular database....wat will happen if i gave database name as master while giving access to a login

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-05-20 : 09:16:17
Think of Logins as at server level, so you would create a login in the security section at the server XYZ, and then user would be create to allow access to the database at the databases level and mapped to the login so think like this

Login allows access to SQL Instance
User Allows access to database
Go to Top of Page

shanilash
Starting Member

17 Posts

Posted - 2009-05-20 : 09:32:40
how can we map the login to a specific database user
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2009-05-20 : 13:00:00
If the login already exists, but it does not yet have access to the database, then use sp_grantdbaccess. If both the server login and the database user already exist but are just not linked to one another (as can happen when restoring a database from one server to another) use sp_change_users_login.

--------------------------------------------
Brand yourself at EmeraldCityDomains.com
Go to Top of Page
   

- Advertisement -