Msg 216, Level 16, State 1, Line 1
Parameters were not supplied for the function ‘%.*ls’.
This error message appears when you don’t supply a value expected by a user-defined function.
The T-SQL statement can be parsed, but causes the error at runtime.
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.
All versions of SQL Server
DROP FUNCTION dbo.BogusOrder
CREATE FUNCTION dbo.BogusOrder
SELECT OrderID, CustomerID
WHERE OrderID = @OrderID
SELECT * FROM dbo.BogusOrder
The above function expects the parameter @OrderID. Because a value for this parameter was not supplied in the function cal, the error is raised.