March 2, 2010 at 10:20 am
Hi,
I searched this site and found plenty of good scripts and Stored Procedures for displaying the permissions for a User defined Database Role.
How would I go about Scripting out the Database Role so that it will generate the Grant statements needed to recreate the Database Role?
March 2, 2010 at 3:46 pm
Have you seen this one? http://www.sqlservercentral.com/scripts/SQL+Server+7%2c+2000/61878/. I've used it to document some of my instances.
Greg
March 2, 2010 at 4:43 pm
Greg Charles (3/2/2010)
Have you seen this one? http://www.sqlservercentral.com/scripts/SQL+Server+7%2c+2000/61878/. I've used it to document some of my instances.
That's a good script.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 2, 2010 at 5:46 pm
I did see that one.. it errors out on me..
Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 4
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Procedure sp_ScriptRoles, Line 74
Must declare the scalar variable "@Role".
Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 112
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 340
Incorrect syntax near 'END'
March 2, 2010 at 6:30 pm
Jpotucek (3/2/2010)
I did see that one.. it errors out on me..Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 4
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Procedure sp_ScriptRoles, Line 74
Must declare the scalar variable "@Role".
Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 112
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Procedure sp_ScriptRoles, Line 340
Incorrect syntax near 'END'
It looks like it may have copied some non-printing characters. Check script in something like notepad++.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 3, 2010 at 12:07 am
try this one
change the extension from .txt to.sql
Sanket Ahir
Don't run behind the success, Try to be eligible & success will run behind u......
March 3, 2010 at 5:07 am
Thank you .. that worked.
I created the SP in my master DB and then executed it like this:
Exec changemanagement_Training..sp_ScriptRoles
and I got this?
Msg 451, Level 16, State 1, Procedure Sp_scriptroles, Line 45
Cannot resolve collation conflict for column 1 in SELECT statement.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply