Home Forums SQL Server 2008 T-SQL (SS2K8) Get all the domain and SQL users from an instance, per database RE: Get all the domain and SQL users from an instance, per database
Robert Klimes
SSCoach
Points: 17865
More actions
October 17, 2012 at 8:41 am
#1550060
this should get you what you want per database (without excluding any users)
select name from sys.database_principals
where type in ('S','G','U')
give it a try with sp_msforeachdb and post back if you are still having issues.
Bob-----------------------------------------------------------------------------How to post to get the best help[/url]