Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ranvir_2k
Posting Yak Master
180 Posts |
Posted - 2011-09-22 : 10:59:04
|
I have a user defined database role on one of my databases.How can I script out the permissions that this role has? |
|
jhnegrao
Yak Posting Veteran
81 Posts |
Posted - 2011-09-22 : 17:00:34
|
Hello,I suppose you are using SSMS 2008, so just click with the right button on the Database Role you want to script out and select "Script Database Role As", then select "CREATE to", then choose the option you preffer.- New Query Editor- File- Clipboard. |
 |
|
DaleTurley
Yak Posting Veteran
76 Posts |
Posted - 2011-09-26 : 12:00:12
|
Use the sys.database_role_members and sys.database_permissions views to get database permissions. |
 |
|
Peter99
Constraint Violating Yak Guru
498 Posts |
Posted - 2011-09-26 : 13:49:45
|
jhnegrao, you cannot script permissions associated with role, method you specified. |
 |
|
jhnegrao
Yak Posting Veteran
81 Posts |
Posted - 2011-09-27 : 08:21:02
|
quote: Originally posted by Peter99 jhnegrao, you cannot script permissions associated with role, method you specified.
Ok. Peter, sorry I misunderstood what our colleagues said...But, Why don't you teach us how to do that?Regards |
 |
|
Peter99
Constraint Violating Yak Guru
498 Posts |
Posted - 2011-09-27 : 11:40:57
|
I followed your method, there was no option to script permissions. I am also looking for method to script permissions associated with roles. |
 |
|
jhnegrao
Yak Posting Veteran
81 Posts |
|
|
|
|
|
|