Cannot find the user ‘username’ because it does not exist or you do not have permission. – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Tue, 29 May 2012 09:12:50 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Msg 15151 Level 16 State 1 Line 1 Cannot find the user ‘username’ because it does not exist or you do not have permission. https://sqlserverlearner.com/2012/05/29/msg-15151-level-16-state-1-line-1-cannot-find-the-user-username-because-it-does-not-exist-or-you-do-not-have-permission/ https://sqlserverlearner.com/2012/05/29/msg-15151-level-16-state-1-line-1-cannot-find-the-user-username-because-it-does-not-exist-or-you-do-not-have-permission/#respond Tue, 29 May 2012 09:12:50 +0000 https://sqlserverlearner.azurewebsites.net/2012/05/29/msg-15151-level-16-state-1-line-1-cannot-find-the-user-username-because-it-does-not-exist-or-you-do-not-have-permission/
Msg 15151, Level 16, State 1, Line 1
Cannot find the user ‘username’, because it does not exist or you do not have permission.

Example:
[sql]
GRANT EXECUTE ON OBJECT::dbo.test to username
[/sql]

Fix/resolution:

– Check if the user exists
[sql]
SELECT * FROM sys.server_principals WHERE name = N’username’
[/sql]
– Check if the stored procedure exists
[sql]
SELECT * FROM sys.procedures WHERE name = N’test’
[/sql]
– Make sure that the query is being executed in the database in which the stored procedure exists

]]>
https://sqlserverlearner.com/2012/05/29/msg-15151-level-16-state-1-line-1-cannot-find-the-user-username-because-it-does-not-exist-or-you-do-not-have-permission/feed/ 0