Finding Orphaned Users

Jon Morisi has a script to find orphaned users:

With the SQL Server 2005 end date approaching, you may find yourself migrating databases.  One of the gotchas with any database migration is orphaned users.  Below is a script I put together, and have been using for years, to help me resolve issues with orphaned users:

I’m not a fan of the sp_msforeachdb in there because there are issues which can cause “each” database to skip databases.  If you have installation authority, Aaron Bertrand’s sp_foreachdb is a better alternative, and if you need to do Insert/Exec calls, there’s a newer version which removes the INSERT/EXEC in that procedure.

Related Posts

Dealing With Noisy Neighbors

Kevin Kline explains what Resource Governor does: There are lots of ways to manage noisy neighbors. For example, you could spin up additional instances of SQL Server on a single physical or virtual machine (VM), and then segregate the applications to a distinct instance. You could also follow the old adage of “one application, one […]

Read More

Creating Database Snapshots

David Fowler has a script which lets you create database snapshots easily: The procedure takes two parameters, @DatabaseList – a comma delimited string of database names, allows wildcards @ListOnly – 1- a list of affected databases will be displayed but snapshots aren’t created. 0- Snapshots are created automatically DEFAULT I’m a big fan of database […]

Read More

Categories

February 2016
MTWTFSS
« Jan Mar »
1234567
891011121314
15161718192021
22232425262728
29