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.




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |