Parameters were not supplied for the function '%.*ls'.

Error Message:
Msg 216, Level 16, State 1, Line 1
Parameters were not supplied for the function ‘%.*ls’.

Severity level:
16.

Description:
This error message appears when you don’t supply a value expected by a user-defined function.

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 user-defind function 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
DROP FUNCTION dbo.BogusOrder
GO
CREATE FUNCTION dbo.BogusOrder
(@OrderID INT)
RETURNS TABLE
AS
RETURN
 SELECT OrderID, CustomerID
   FROM dbo.Orders
  WHERE OrderID = @OrderID
GO
SELECT * FROM dbo.BogusOrder

Remarks:
The above function expects the parameter @OrderID. Because a value for this parameter was not supplied in the function cal, the error is raised.

]]>

Leave a comment

Your email address will not be published.