Guest is user or login | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Guest is user or login

I would like to know where Guest is user or login. Your help is appreciated!
I feel Guest is a user with login rights.
So a guest can login to access few things with restrictions.
SQL Books online has good explanation for this question: – Guest User
The guest user account allows a login without a user account to access a database. A login assumes the identity of the guest user when both of the following conditions are met: The login has access to an instance of Microsoft® SQL Server™ but does not have access to the database through his or her own user account.
The database contains a guest user account.
Permissions can be applied to the guest user as if it were any other user account. The guest user can be deleted and added to all databases except master and tempdb, where it must always exist. By default, a guest user account does not exist in newly created databases. For example, to add a guest user account to a database named Accounts, run the following code in SQL Query Analyzer: USE Accounts
GO
EXECUTE sp_grantdbaccess guest Deepak Kumar –An eye for an eye and everyone shall be blind
A little more clarification <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><br />A login ID by itself does not give a user permissions to access objects in any databases. A login ID must be associated with a user ID in each database before anyone connecting with that login ID can access objects in the databases. If a login ID has not been explicitly associated with any user ID in a database, it is associated with the guest user ID. If a database has no guest user account, a login cannot access the database unless it has been associated with a valid user account.<br /><br />Deepak Kumar<br /><br />–An eye for an eye and everyone shall be blind
Thanks for your reply. In sql server we can create logins which does not map to any of user(s). But we can not create user in database which does not map to login(s). If above statement is correct then guest must be a login otherwise SQL Server should allows us to create user which does not map to login(s).
The guest account is a special user account in SQL Server databases. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
I edited my post to empty <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /> .<br />I saw Deepak’s comments later only.Now its all clear for me
]]>