Solved

SQL Server 2005 - SQL to Grant SELECT Perms on a Single Table

Posted on 2010-08-19
2
394 Views
Last Modified: 2012-05-10
We must manually type SQL to grant permissions.  Otherwise, our SOX monitoring software requires manual follow-up.  This is a directive from management, so we don't have the option to use the nice point and click tools available in SQL Server Management Studio.  We're using Windows authentication.  Assume the following info:
-Domain = dom
-Windows Active Directory group = grp
-Server = srv
-Database Name = db
-Table Name = tbl

If the Active Directory group has no current database perms, what is the SQL needed so that members of the Active Directory group can issue SELECT statements against the table (read-only)?

Thanks so much for any help you can offer.
0
Comment
Question by:nfeliciano
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 50 total points
ID: 33480680
If you don't already have the AD group as a valid login to SQL

CREATE LOGIN [dom\grp] FROM WINDOWS

Create the user within the database tied to the login

CREATE USER grp for login [dom\grp]

Give select permission

GRANT SELECT ON tbl TO grp

If the database has PUBLIC role activated and defaults to GRANT SELECT to PUBLIC, then the AD group would be able to select from all tables anyway.
0
 

Author Closing Comment

by:nfeliciano
ID: 33480774
Your concise explanation also included other helpful info.  Thanks so much for the quick answer.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now