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
Printable View
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
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
[email protected]
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