![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to take about 300 SP's and strip out whatever permissions are assigned to them - then add one role: db_procexecutor_write to each one. For example - at the bottom of this SP is: .... go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINADMIN go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNS go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNSSUPV go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCOMPILEALL When I'm done - it should only have: GRANT EXECUTE ON db_procexecutor_write |
#3
| |||
| |||
|
|
news.microsoft.com wrote: I need to take about 300 SP's and strip out whatever permissions are assigned to them - then add one role: db_procexecutor_write to each one. For example - at the bottom of this SP is: .... go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINADMIN go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNS go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNSSUPV go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCOMPILEALL When I'm done - it should only have: GRANT EXECUTE ON db_procexecutor_write If you no longer require the roles: 1- Drop each role using sp_droprole 2- Change the GRANT statements in each proc and re-execute, or manually grant rights to each procedure to the new role If you need to keep the roles: 1- Insert the names of all the procedures into a temp table 2- Loop through the temp table using a cursor 3- In the loop, revoke the rights from each group and grant the new rights -- David Gugick Imceda Software www.imceda.com |
#4
| |||
| |||
|
|
This approach still requires manually adding my role to each proc...I know there is a way to programatically do it... |
#5
| |||
| |||
|
|
I need to take about 300 SP's and strip out whatever permissions are assigned to them - then add one role: db_procexecutor_write to each one. For example - at the bottom of this SP is: .... go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINADMIN go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNS go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCNSSUPV go GRANT EXECUTE ON dbo.p_CnsAct_i TO WINCOMPILEALL When I'm done - it should only have: GRANT EXECUTE ON db_procexecutor_write |
![]() |
| Thread Tools | |
| Display Modes | |
| |