CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Posts
    33

    SQL Server Manage Permission

    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



  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: SQL Server Manage Permission

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured