SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database User and Roles Script Extract Needed


Database User and Roles Script Extract Needed

Author
Message
S. Kusen
S. Kusen
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2825 Visits: 1119
logicinside22 (3/28/2013)
Hi
I am looking for same script to generate script for User DB roles . Can you share if you have it now?
Or if anyone have it can share ?
Thanks


I think the script I have posted here should work. I just created an empty DB, added a table, added a new role, and issued a "grant select on dbo.table1 to test_role" and then executed the script.

The output I got back was under object level permissions for that role:
-- [-- OBJECT LEVEL PERMISSIONS --] --
GRANT SELECT ON [dbo].[table1] TO [test_role1]



Check that out and let me know if something is missing there.

Cheers,
Steve
pruthvirajgowda 8776
pruthvirajgowda 8776
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 39
this will script out everything

http://dbasqlhelp.blogspot.in/2015/11/extract-all-database-permissions-before.html


remove the last insert which will fix orphan users
pruthvirajgowda 8776
pruthvirajgowda 8776
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 39
https://gallery.technet.microsoft.com/Extract-Database-dfa53d5a

that might help you
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search