SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Orphaned login report for all databases

By Edward Pochinski,

Automating redundant items are time savers. I got tired of running this against each db with a USE command or dropping down the db dropdown box. This is a simple cursor that loops through each db and will show any orphaned logins if they exist on the system.

Usage: Cut and paste into a query window and run

Total article views: 962 | Views in the last 30 days: 3
orphaned users