Step1: SELECT SUSER_SID( 'Domain\LoginName');
SID:0x010500000000000515000000C5F84793CB280B51AD7C2F5320370000
Step2:
Select * from sys.server_principals
where SID=0x010500000000000515000000C5F84793CB280B51AD7C2F5320370000
go
Step3:
drop login [Domain\LoginName']
go
Step4:
CREATE LOGIN [Domain\LoginName' FROM WINDOWS WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english]
go
Step5: If required, this is for a particular database
USE AuditDB
go
EXEC sp_addrolemember 'db_datareader', 'Domain\LoginName''
GO
No comments:
Post a Comment