0

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.

1
  • Has this UserName 'special' characters?
    – McNets
    Oct 13, 2019 at 17:04

1 Answer 1

0

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'
1
  • Thanks that query works if I add N' but problem here is that it gets built by installation wizard of application which fails because of that... And it happens only for one specific account...
    – Mikhail
    Oct 13, 2019 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.