Steps to find orphan users in MSSQL Server

kumkumsharma

Administrator
Staff member
Orphaned users can be mostly created while database migration when the database user is available on server but its login doesn’t available on server.

You can run below query to check the orphaned users in MSSQL.

Code:
USE
USER DATABASE
EXEC SP_CHANGE_USERS_LOGIN ‘REPORT’
GO
We can fix this issue with ORPHANED USER SID by creating its login.

Syntax:

Code:
USE
MASTER
CREATE LOGIN [LoginName] WITH PASSWORD = ‘login@123’,
SID = 0xF0C10D1C8EDFGA06435B07DAD54FFAE
 
Top