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 2005 Forums
 SQL Server Administration (2005)
 User permissions

Author  Topic 

DBlanky
Starting Member

3 Posts

Posted - 2008-04-28 : 15:45:45
Hey all,

Just trying to figure out how to set a users permission in SQL 2005. Ive got one user but I only want them to be able to view data from one or two tables or and views, but can I do this without having to deny access to every other table?

Thanks
Daniel

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 15:46:44
GRANT SELECT ON SomeTable1 TO SomeUser
GRANT SELECT ON SomeTable2 TO SomeUser
GRANT SELECT ON SomeView1 TO SomeUser

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

DBlanky
Starting Member

3 Posts

Posted - 2008-04-28 : 19:00:51
How do I stop them from being able to access any other table though?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 19:15:23
You don't get permissions by default, so if they already can see the other tables, then you need to check how they are getting that access. Are they in a database or server role?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -