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 |
ggarza75
Yak Posting Veteran
50 Posts |
Posted - 2009-01-16 : 12:23:29
|
So I use sp_helprotect to get an output of all object permissions. This helps when I look at one database instance. What can do to have this same command run against several database instances at once and viewed in one query.Hope this makes sense. Thanks. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-16 : 12:27:47
|
use the above inside sp_Msforeachdb to repeat for dbs |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-16 : 12:29:18
|
also see:-http://www.databasejournal.com/features/mssql/article.php/3441031/SQL-Server-Undocumented-Stored-Procedures-spMSforeachtable-and-spMSforeachdb.htm |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-16 : 15:14:11
|
You can use like this:EXEC sp_MSForeachdb 'USE ? IF ''?'' <> ''master'' AND ''?'' <> ''model'' AND ''?'' <> ''msdb'' AND ''?'' <> ''tempdb''BEGINEXEC sp_helprotectEND' |
|
|
|
|
|