Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Removing Orphan Users from All databases on Server Expand / Collapse
Author
Message
Posted Sunday, November 17, 2002 12:00 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, June 6, 2014 2:06 PM
Points: 1,040, Visits: 277
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/glarsen/orphan_user.asp

Gregory A. Larsen, MVP

Need SQL Server Examples check out my website at http://www.sqlserverexamples.com
Post #8232
Posted Thursday, July 5, 2007 9:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 13, 2009 11:39 AM
Points: 1, Visits: 5
For SQL Server 2005,I also think you need to exclude the predefined database users,dbo and sys.The query needs to be modified as follows:

select u.name from master..syslogins l right join sysusers u on l.sid = u.sid where l.sid is null and issqlrole <> 1 and isapprole <> 1 and (u.name <> 'INFORMATION_SCHEMA' and u.name <> 'guest'
and u.name <> 'system_function_schema' and u.name<> 'dbo' and u.name <> 'sys')
Post #379288
Posted Thursday, October 29, 2009 12:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, February 26, 2012 4:48 PM
Points: 1, Visits: 89
Hi Greg,

I run the Store Proc but when i go to individual databases and run EXEC sp_change_users_login 'Report';
it still show me orphaned users..Please let me know if i am missing something
Post #810525
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse