I am trying to implement Row Level Security and have mapped an AD Security Group to a user in my test Database. When trying to select data from a table that I have granted access to I am not getting my intended result. I have added select USER_NAME() to see what is being checked on my predicate function and I get the Windows login and not the database user.

  • is that the only authorization path that you have to the server? – Jonathan Fite Apr 15 at 17:26
  • Yes, I created a test user for this project on my local database. – lotsir35 Apr 15 at 17:46

If a Windows principal accessed the database by way of membership in a group, CURRENT_USER will return the name of the Windows principal instead of the group name. https://docs.microsoft.com/en-us/sql/t-sql/functions/current-user-transact-sql?view=sql-server-ver15

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.