I have the following database and users:
I would like to be able to check what permissions users have to certain tables. I can run the following command and get the permissions for tgrover:
USE ClearToPack
Go
EXECUTE AS USER = N'tgrover';
SELECT DISTINCT permission_name AS Permission
FROM sys.fn_my_permissions(N'ClearToPack.dbo.BoxPart', N'OBJECT')
ORDER BY permission_name;
But if I run the same query using the MyotekUser or ManexUser I receive the following error:
For MyotekUser:
Msg 15517, Level 16, State 1, Line 4
Cannot execute as the database principal because the principal "MyotekUser" does not exist, this type of principal cannot be impersonated, or you do not have permission.
For ManexUser:
Msg 15517, Level 16, State 1, Line 4
Cannot execute as the database principal because the principal "ManexUser" does not exist, this type of principal cannot be impersonated, or you do not have permission.
Why would I not be able to retrieve the permissions for MyotekUser and ManexUser?
I have tried MyotekUser or ManexUser several times.