Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    india
    Posts
    67

    Unanswered: Grant select permission on all tables

    Hi Gurus, Can any one tell me how to grant select permisision all tables in a DB

    like Grant all on [all tables] to myuser.


    Thanks in advance.
    Srinivas varanasi

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Use the Information Schema views...like

    SELECT 'GRANT SELECT ON ' + TABLE_NAME + ' TO USER'
    FROM INFORMATION_SCHEMA.Tables

    Now this is from the public library 9:30 sat morning folks, so check the syntax...


    No testing here
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jul 2004
    Posts
    60
    another idea is

    sp_addrolemember 'db_datareader' ,
    '[domain\username] or [username]'

    thats not exactly a 'grant' but it will give the user read access to all tables in the database.

Posting Permissions

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