Friday, January 2, 2015

Orphan users in SQL Server

Orphan User Only sql user(Not Windows/ AD account ) can be orphan user after refreshing Database. To find user run below command
use DatabaseName
go
Exec s p_change_users_login 'report'
go

Now You will see the list of sql orphan users for that database

To fix orphan users - run the below command
use DatabaseName
go
Exec sp_change_users_login 'auto_fix', 'user'
go

 

 

No comments:

Post a Comment