Does anybody know "grant permission to multiple users" in sql

  • anybody does plzzz..sennd the code!!!!!!

  • I generally create the query dynamically and execute IT there after

    Use DBName

    SELECT 'GRANT EXECUTE ON <OBJECTNAME > TO ' + NAME FROM SYSUSERS

    Hope this helps

  • jude.pieries (8/21/2010)


    SELECT 'GRANT EXECUTE ON <OBJECTNAME > TO ' + NAME FROM SYSUSERS

    sysusers is deprecated, should not be used for new development and will be removed in a future version of SQL. It is only included for backward compatibility with SQL 2000.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • use the following syntax

    GRANT <permission>, <permission>, ... ON OBJECT::dbo.mytable

    TO [user1], [user2], [user3], ..........

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • You can try syntax in following pattern:

    GRANT <permission> on <Object Name> to <User Name1>, <User Name2>..... <User Name n>

    example:

    grant select on test to SQLVillage,SQLVillage_Reader

    P.S. Realized little later that Perry Whittle has already answered

    [font="Verdana"]--www.sqlvillage.com[/size][/font]

  • I would make a database role, add users to the role and assign the permissions to the role.

    You assign the permissions only once and you can add or delete users as needed from the role.

    Steve

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply