Procedure or function '%.*ls' expects parameter '%.*ls', which was not supplied.

Error Message:
Msg 201, Level 16, State 4, Procedure BogusOrder, Line 0
Procedure or function ‘%.*ls’ expects parameter ‘%.*ls’, which was not supplied.

Severity level:
16.

Description:
This error message appears when you don’t supply a value for a parameter expected by a stored procedure.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. You must supply values for each parameter in a stored procedure as long as there is not default value for that parameter defined. These supplied values must explicitly or implicitly be convertible to the parameter in question.

Versions:
All versions of SQL Server

Example(s):
USE Northwind
GO
CREATE PROCEDURE dbo.BogusOrder
(@OrderID INT)
AS
SET NOCOUNT ON
SELECT *
  FROM dbo.Orders
 WHERE OrderID = @OrderID
RETURN 0
GO
EXEC dbo.BogusOrder
DROP PROCEDURE dbo.BogusOrder

Remarks:
The above procedure expect the parameter @OrderID. Because there was no value supplied with the EXEC call, the error is raised.

]]>

Leave a comment

Your email address will not be published.