FIX: SQL Server may crash when a request for execution of a remote stored procedure contains incomplete definition of arguments

Symptoms
On a remote server that's running Microsoft SQL Server 2012 or SQL Server 2014, you have a stored procedure that has an output argument that resembles the following:

create procedure procExample @retVal varchar(10) outputas set @retVal = 'Goodbye';
Typically, the syntax to invoke such a remote procedure resembles the following:

-- Declare a variable to hold a result, and have it initialized with a non-NULL valuedeclare @outputResult varchar(10) = 'Hello';execute ('MyDb.dbo.procExample ? OUTPUT', @outputResult OUTPUT) at [MyRemoteServer];print @outputResult;
If you omit the "? OUTPUT" part of the call syntax, the local server that's running SQL Server may crash. The remote server continue to operate because the execution never reaches it because of this syntax omission. For example, the syntax resembles the following:

-- Declare a variable to hold a result, and have it initialized with a non-NULL valuedeclare @outputResult varchar(10) = 'Hello';execute ('MyDb.dbo.procExample', @outputResult OUTPUT) at [MyRemoteServer];
A variable that has not been initialized does not cause the local server to crash. However, it does generate an error message that states that not all arguments are specified for the call (as they should be). For example, you have the following syntax:

-- Declare a variable to hold a result, and initialize it with NULL, or leave uninitializeddeclare @outputResult varchar(10) = NULL;execute ('MyDb.dbo.procExample', @outputResult OUTPUT) at [MyRemoteServer];
In this case, you receive an error message that resembles the following:

Msg 201, Level 16, State 4, Procedure procExample, Line 10

Procedure or function 'procExample' expects parameter '@retVal', which was not supplied.
Resolution

Update information

This issue was first fixed in the following cumulative update for SQL Server:
Recommendation: Install the latest cumulative update for SQL Server

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included in the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Note You can find information about the latest SQL Server builds from Where to find information about the latest SQL Server builds.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
References
Learn about the terminology that Microsoft uses to describe software updates.
Properties

Article ID: 3135750 - Last Review: 05/31/2016 07:52:00 - Revision: 4.0

Microsoft SQL Server 2012 Service Pack 2, Microsoft SQL Server 2014 Service Pack 1, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Standard

  • kbqfe kbfix kbexpertiseinter kbsurveynew KB3135750
Feedback