Reputation: 6530
I am facing a strange issue. I have a linked server on ServerB for ServerA
Now, when I am calling a stored procedure from ServerB like
EXEC [ServerA].[Db].[dbo].[SpName] @Param1 @param2
I am getting error that
The EXECUTE permission was denied on the object 'SpName', database 'Db', schema 'dbo'.
But now when I am executing below query it is returning me result:
SELECT *
FROM [ServerA].[Db].[dbo].[tblName]
I don't know that why I am not able to execute stored procedure from ServerB. I am Db_Owner
on both the server.
Screenshot of Linked server security
Linked server catalog
Upvotes: 2
Views: 9712
Reputation: 28769
If a linked server query fails, the things to check are (in rough order of probability):
EXEC ('SELECT USER_NAME(), SUSER_NAME()') AT [Server]
; if the user name is not what you're expecting, check your linked server definition for the correct login mappings. If you can't access the server at all (any query fails), you have other problems (like Kerberos authentication issues if you're using integrated authentication).EXEC ('SELECT @@SERVERNAME') AT [Server]
. The network name of a linked server can be changed using sp_setnetname
, so the name you use to a access the server isn't necessarily the machine name.Upvotes: 3