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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Guest logins in SQL Server

Author  Topic 

abansal
Starting Member

4 Posts

Posted - 2004-06-02 : 16:45:27
This might be an easy question, I'm still a newbie to SQL Server.

Is it possible that when a user tries to access a database, if their login is not within the SQL Server Security login, that they are given access through a guest account (where the guest only has read only access to the data). In other words, if the user account is not found within the logins table, then they are put into a default group.

I have a database which should allow only Administrators to change the data, but allow everyone else to view the information.

thanks,
Bobby

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-02 : 16:48:13
Create two SQL roles in the database, one for the admins and one for everyone else. Grant the admin role db_datawriter and db_datareader. Grant the other role only db_datareader. If you are doing to do this through stored procedures only like is the recommendation, then just grant EXEC statements to the roles to the appropriate stored procs.

Tara
Go to Top of Page

abansal
Starting Member

4 Posts

Posted - 2004-06-02 : 17:18:54
Thanks for the quick response.

Wouldn't I still have to know the NT logins for all the users so that I could add them to the public role?? Is it possible to not know the NT users and grant them access to certain tables and databases?

Bobby
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-02 : 17:22:35
There is a guest account in SQL Server, but it is highly not recommended to use it. You can read up on it in SQL Server Books Online.

You don't need to know the accounts. They just need to be organized into groups at the Active Directory or Domain layer. Then just add the groups to the roles.

Tara
Go to Top of Page
   

- Advertisement -