Sql-server – Querying sys.server_principals does not return results for specific user

sql serversql server 2014

I'm trying to figure out why this query:

SELECT * FROM sys.server_principals WHERE sid = SUSER_SID('Domain\User') OR name = 'Domain\User'

Does not return results for one specific user? At the same time if I remove/comment out WHERE clause I can see that SELECT Domain\User… I've tried to remove and re-add this user under SQL Server > Security > Logins – but it does not help. Can someone indicate what can be wrong here? User name contains non-Latin characters, but no special characters.

Best Answer

Tried your query, worked fine for me.. only thing I can think about for you is try adding N to the 'Domain\User' in your case:

SELECT * FROM sys.server_principals WHERE sid = SUSER_SID(N'Domain\User') OR name = N'Domain\User'