Trying to understand the relationship between a db login and a db user?
-
I am new to SQL Server 2005...and was reviewing the following msdn url for creating logins and users: msdn.microsoft.com/en-us/library/aa337552.aspx Can someone explain what the difference is between a db login and a db user? From my understanding, you use the db login within SQL Server manager, or with your .NET code, correct? Then, you create a user and associate it to a login? Why? What's the relevance of knowing or having a user associated to a login, when the login is sufficient alone? Would I use the user logging into sql server mgr or within my .net code? Do I need to associate a login with a user? thanks!
-
I am new to SQL Server 2005...and was reviewing the following msdn url for creating logins and users: msdn.microsoft.com/en-us/library/aa337552.aspx Can someone explain what the difference is between a db login and a db user? From my understanding, you use the db login within SQL Server manager, or with your .NET code, correct? Then, you create a user and associate it to a login? Why? What's the relevance of knowing or having a user associated to a login, when the login is sufficient alone? Would I use the user logging into sql server mgr or within my .net code? Do I need to associate a login with a user? thanks!
A login connects you to the SQL Server instance. A database user defines what privileges a login has within a particular database. If you have multiple databases on your server, you probably don't want everyone who can connect to the server (login) have some kind of access to every database. So you could have a login associated with one database or with several.
Someone's gotta be the last to know, but why is it always me?