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
 General SQL Server Forums
 New to SQL Server Programming
 Privileges

Author  Topic 

Christech82
Starting Member

20 Posts

Posted - 2013-04-26 : 16:06:47
Hi there
I have question regarding granting privileges to some one int he company
as I have a receptionist and would like to grant her /him privilege on some tables I hold. The receptionist clients details, videos details,
contract Details. How do I do that in theory.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-26 : 16:51:45
There are different ways in which you could give permissions to a user to access a set of securables.

One way would be simply grant permissions to that user. So you would do something like
GRANT SELECT ON YourTableName TO TheUserName

http://msdn.microsoft.com/en-us/library/ms187965.aspx

But that probably is not the best and most maintainable way to do it. What you should ideally do is to create a new role (or all administrative assistants, for example). Then, grant privileges to the role and add the user to that role.

Another alternative is to use an active directory group. You would have an administrative assistants group who would be a user on the database. You will grant permissions to the group.
Go to Top of Page

Christech82
Starting Member

20 Posts

Posted - 2013-04-26 : 17:20:49
quote:
Originally posted by James K

There are different ways in which you could give permissions to a user to access a set of securables.

One way would be simply grant permissions to that user. So you would do something like
GRANT SELECT ON YourTableName TO TheUserName

http://msdn.microsoft.com/en-us/library/ms187965.aspx

But that probably is not the best and most maintainable way to do it. What you should ideally do is to create a new role (or all administrative assistants, for example). Then, grant privileges to the role and add the user to that role.

Another alternative is to use an active directory group. You would have an administrative assistants group who would be a user on the database. You will grant permissions to the group.





Thank you for answering

If I wanted to create a new role for admin assistance for example, what are kind of privileges(besides select, insert, alter) can he/she get in the system?


Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-26 : 17:28:47
If you don't grant the user/role any other privileges they won't have any other privileges. I am saying that in a loose sense. They will be, for example, able to see what databases are on the server (even though they won't be able to access any data or look at the schema of any other database).

The kinds of privileges that you can grant are listed here: http://msdn.microsoft.com/en-us/library/ms187965.aspx In SQL Server nomenclature, those are securables. SQL Server uses the concept of securables and principals. Principals are granted permissions on securables. The picture on this page explains it better than I can: http://msdn.microsoft.com/en-us/library/ms191465.aspx
Go to Top of Page
   

- Advertisement -