We know that SQL Server has a very strong selection of drivers for a linked server (linked server), a linked server (linked server) that was recently established with the Microsoft OLE DB driver for ODBC, and when the stored procedure procedure was invoked, Parameter cannot be a null value.
Otherwise, the following error message will be reported:
The corresponding English error prompts are:
EXEC xxx.xxx.dbo.Usp_Test null,null, ' all '
MSG 7213, level, State 1, line 1
The attempt by the provider to pass remote stored procedure parameters to remote server ' xxx ' failed. Verify that number of parameters, the order, and the values passed are correct.
The corresponding Chinese error prompts are:
EXEC xxx.xxx.dbo.Usp_Test null,null, ' all '
MSG 7213, level, State 1, line 1
The provider failed to pass the remote stored procedure parameter to the remote server ' xxx '. Make sure the number, order, and value of the parameters are correct.
EXEC xxx.xxx.dbo.Usp_Test ', ', ' all ' or giving the parameter an appropriate value does not report any errors. Alternatively, the parameter can be NULL when calling a stored procedure using the Microsoft OLE DB Provider for SQL server-driven linked server (linked server).
The above is a small compilation for everyone to share SQL Server using ODBC-driven linked server to call the stored procedure when the parameter can not be null value of all the content, I hope you like.