Sorry. I keep accidentally saying "table" when I mean "database".
What I need to do is query the sysusers table, which has a list of all users with permission to access the database, in every database. Then, I need to return the list of databases that a specific user has permission to use...
If I run this:
<code>
EXEC sp_MSforeachdb @command1="select * from sysusers"
</code>
It seems to run the query on the same database every time. It gives me a 18 matching result sets (there are 18 dbs on the server)
Thank you! I've been looking all over for something like that.
Please bear with me, I'm brand new to sql and I'm still confused about how to get what I want here. in the command portion, I obviously need to supply a qry to be run on each table. But the thing is, in each qry I need to...
Hi,
I have need to query the master database to get a list of all databases, and then use a passed-in username to query every database's sysusers table to see if a specific user has permission to access the database. Then, I need to return a recordset to an asp page that contains only the list...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.