How to fix “Server is not configured for RPC” Msg 7411 using T-SQL

If you’ve encountered error Msg 7411, Level 16 in SQL Server, it’s because you need to enable “RPC out” on the linked server that you’re trying to execute code on.

Example of Code that Causes the Error

For me, running the following code results in the Msg 7411 error.

EXEC Homer.Music.dbo.spAlbumsFromArtist 
    @ArtistName = 'Iron Maiden';

Here, I’m trying to execute a stored procedure on the linked server. But I don’t have “RPC out” enabled and so I get the following error:

Msg 7411, Level 16, State 1, Line 1
Server 'Homer' is not configured for RPC.

Even though it reads “RPC”, it means “RPC out”.

Check the RPC Out Setting

We can check our RPC out setting with the following code.

SELECT 
    is_rpc_out_enabled
FROM sys.servers
WHERE name = 'Homer';

Result:

+----------------------+
| is_rpc_out_enabled   |
|----------------------|
| 0                    |
+----------------------+

As expected, it’s not enabled.

The Solution

The following code enables the “RPC out” option for the linked server:

EXEC sp_serveroption 'Homer', 'rpc out', 'true';

Result:

Commands completed successfully.

Great, success.

So if we check our RPC out setting again, it should now be set to 1.

Verify the RPC Out Setting

Let’s run the code again.

SELECT 
    is_rpc_out_enabled
FROM sys.servers
WHERE name = 'Homer';

Result:

+----------------------+
| is_rpc_out_enabled   |
|----------------------|
| 1                    |
+----------------------+

Perfect!

So we should now be able to run the stored procedure without getting the 7411 error.

Try Running our Original Code Again

Now we can try executing the remote stored procedure again, and hopefully we don’t get any more errors.

EXEC Homer.Music.dbo.spAlbumsFromArtist 
    @ArtistName = 'Iron Maiden';

Result:

+-------------------------+---------------+
| AlbumName               | ReleaseDate   |
|-------------------------+---------------|
| Powerslave              | 1984-09-03    |
| Somewhere in Time       | 1986-09-29    |
| Piece of Mind           | 1983-05-16    |
| Killers                 | 1981-02-02    |
| No Prayer for the Dying | 1990-10-01    |
+-------------------------+---------------+

Fixed!