September 17, 2009 at 12:04 pm
Hi,
I am new to sql server. I am bit confused with the database users and logins, i know that we need to have a user to access the database after loggin in, also i know that every database users must be mapped to a login. But when i look at the existing databases i see different logins ( windows logins in sql server) but i see only standard database users ( dbo,sys etc.,). In some databases i see a database users for every login. I am confused, can someone explain me how it works.
Thanks,
ek
September 17, 2009 at 1:25 pm
A login allows you access to the server. A user allows you to access a database. The link between these is what gives you access to the data (and permissions on the objects).
There are cases where you might create a login for access to some function, but not a user in a database, or in every database. Credentials are sometimes used here.
For most users, you give a login access (either Windows or SQL authenticated user) and then map that to a user in a database. You can have one login on the server, but different users in various databases.
September 17, 2009 at 4:15 pm
Thanks for your reply.
I have various windows logins but no corresponding users in the databases, but those logins are still able to access the database and do the stuff. Is that something with roles that the logins have ? like if the login has sysadmin role then no need to create a database user... ?
September 17, 2009 at 4:37 pm
Correct, some roles do not need a database user. They will typically be mapped to some user, like guest or dbo. A sysadmin will map to dbo.
September 17, 2009 at 5:06 pm
Thanks for clearing all my doubts 🙂
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply