Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Does anybody know "grant permission to multiple users" in sql Expand / Collapse
Author
Message
Posted Saturday, August 21, 2010 7:08 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, August 21, 2010 7:40 PM
Points: 20, Visits: 31
anybody does plzzz..sennd the code!!!!!!
Post #973015
Posted Saturday, August 21, 2010 11:26 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 8:06 PM
Points: 33, Visits: 287
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
Post #973022
Posted Sunday, August 22, 2010 10:33 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:10 AM
Points: 42,427, Visits: 35,485
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 2008, MVP
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

Post #973077
Posted Sunday, August 22, 2010 12:03 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:08 AM
Points: 6,162, Visits: 13,305
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"
Post #973087
Posted Sunday, August 22, 2010 11:46 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 3, 2013 4:44 PM
Points: 1,336, Visits: 595
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


--www.sqlvillage.com
Post #973202
Posted Tuesday, August 24, 2010 10:41 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, May 21, 2012 3:13 PM
Points: 516, Visits: 1,563
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



Post #974297
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse