SQL Server Tips: an orphan user owns a database role
A few days ago, I conduct an audit to detect all orphan’s windows accounts in a database and I was surprise to have an error during the drop user query. The first step is to find all orphan’s windows accounts in a database USE [dbi_database] GO /*Step1: Search the orphan user */ SELECT * FROM sys.database_principals a LEFT OUTER…












