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

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.

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

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.
Random Solutions  
 
programming4us programming4us