June 24, 2004 at 10:50 pm
What I am really trying to do is create a script that will list all permissions for any role that doesn't start with db_ on every database.
Does anybody have something like that?
Could you point me in the right direction for a loop that will execute a statement for each database in an instance?
I found a great script on this sight for the main part of my problem!! This site is awesome.
http://www.sqlservercentral.com/scripts/contributions/1080.asp
So i am still clueless for setting up a looping structure to run this sp on each of the databases.
June 25, 2004 at 12:09 am
Here's a routine that executes the same command for all databases in an instance. You should be able to modify it to plug in your commands.
declare @sql varchar(400)
set @sql='select ''?''as dbname;select name, fileid, filename from ?.dbo.sysfiles'
exec sp_msforeachdb @sql
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
June 28, 2004 at 7:50 am
You may also want to check out: sp_helplogins
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply