Share via


SQL Server Troubleshooting: The server principal already exists – MSG 15025, LEVEL 16, STATE 2, LINE 1

Error

Error message: THE SERVER PRINCIPAL ALREADY EXISTS ? MSG 15025, LEVEL 16, STATE 2, LINE 1

Background

I cannot find the login physically though but getting the error while trying to create a new login.

  

Solution

Use below scripts to fix the issue

select suser_sid ('Domain\loginName'); go
 
Result: 0x0105000000000005150000000C04XXXXXXXXXXXXXXXXXXXXXXXXX
 
select * from sys.server_principals sp where sid=0x0105000000000005150000000C04XXXXXXXXXXXXXXXXXXXXXXXXX
 
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'Domain\LoginName') DROP LOGIN [Domain\LoginName]

Able to create a new login now.