Click to See Complete Forum and Search --> : SQL Server Manage Permission


kamu
October 7th, 2001, 07:06 PM
Hi,
Can someone tell me how to manage the permission of the tables and SPs in SQL sever database using the script. Everytime I create a new table or new SP, I have to manually give the permission for the user.

Thanx

Cakkie
October 8th, 2001, 01:28 AM
You can use the GRANT permission statement for that.

' Allow someone to select from a table
GRANT SELECT on SomeTable to public

' Allow someone to insert in a table
GRANT INSERT, UPDATE, DELETE on SomeOtherTable to Tom, Cakkie, [SomeDomain\SomeUser]

' Allow someone to execute a stored procedure
GRANT EXECUTE on SomeStoredProcedure to TheGood, TheBad, TheUgly




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook