Troubleshooting Guide: Error 7380 – Table-Valued Parameters Not Allowed in Remote Calls
Why This Error Happens
This error occurs because SQL Server’s remote procedure call (RPC) architecture does not support passing table-valued parameters (TVPs) across linked server connections. The SQL Server engine explicitly blocks TVPs in distributed queries since the remote provider cannot serialize the tabular structure over the linked server protocol. This typically surfaces when an application or stored procedure attempts to execute a remote stored procedure call that includes a TVP as an input parameter, either directly or through a four-part naming convention against a linked server.
Step-by-Step Resolution Guide
Step 1: Identify the Offending Query or Procedure
- Check the SQL Server error log or Extended Events session for the exact statement raising Error 7380.
- Look for
EXECcalls using four-part names (e.g.,LinkedServerName.DatabaseName.SchemaName.ProcedureName) that pass a TVP. - Confirm the parameter type using
sys.table_typesandsys.parameterson the source procedure definition.
Step 2: Refactor the Remote Call to Avoid TVPs
- Replace the direct remote TVP call with a local wrapper stored procedure on the target server that accepts the TVP natively.
- Use
OPENQUERYorsp_executesqlon the remote server instead of a direct linked server RPC call. - Alternatively, serialize the TVP data into XML or JSON format, pass it as a
NVARCHAR(MAX)parameter, and deserialize it on the receiving end usingOPENJSONornodes()XML shredding.
Step 3: Reconfigure the Linked Server Settings
- Open SQL Server Management Studio (SSMS) and navigate to Server Objects > Linked Servers.
- Right-click the relevant linked server, select Properties, and under the Server Options page, ensure RPC and RPC Out are both set to
True. - Run the following T-SQL to verify and update linked server RPC settings:
EXEC sp_serveroption 'YourLinkedServerName', 'rpc', 'true';
EXEC sp_serveroption 'YourLinkedServerName', 'rpc out', 'true';
- Restart the SQL Server service via Services.msc on Windows Server 2025 for changes to take effect if connectivity issues persist.
Step 4: Update Application Connection Logic
- If the call originates from an application (e.g., .NET, Java), modify the data access layer to split the TVP into individual parameters or a delimited string before sending it over the linked server connection.
- Ensure the application’s connection string does not force remote TVP binding; check ADO.NET
SqlCommand.ParametersforSqlDbType.Structuredusage against remote endpoints and redirect it to a local-only call path.
Alternative or Verification Steps
- Run the modified procedure or query in SSMS against the linked server and confirm no 7380 error appears; check
sys.dm_exec_requeststo confirm successful execution without RPC failures. - As a fallback, deploy the stored procedure directly on the target server (rather than calling it remotely) and invoke it locally via application-level connection switching to completely bypass the linked server TVP limitation.