Monday, December 3, 2012

How to resolve: Msg 7411, Level 16, State 1, Line 1 Server 'MyServer' is not configured for RPC.

 

If you get the following error when trying to execute a stored procedure on a Linked Server in MS SQL Server you need to enable RPC on the server that has the linked server defined (I called my linked serverMyServer in this example)

Msg 7411, Level 16, State 1, Line 1

Server 'MyServer' is not configured for RPC.

The solution is simple, just execute the following SQL on the server where you have defined the Linked Server. You will need to change MyServer to the name of your linked server.

EXEC master.dbo.sp_serveroption @server=N'MyServer', @optname=N'rpc', @optvalue=N'true'
GO

EXEC master.dbo.sp_serveroption @server=N'MyServer', @optname=N'rpc out', @optvalue=N'true'

You need RPC enabled on the Linked Server so that you can called stored procedures. In most cases you only need to do the second one that allows out, but if you have problems you can do the first one also. Most people recommend doing both even though both are not needed in many cases.

No comments: