I'm using classic ASP and trying to create parameters for a stored procedure call for a procedure that has optional (=NULL) parameters. One of the parameters, @maxrows, is required.
When I try to pass via the following call:
With objCommand
.ActiveConnection = oConn
.CommandText = "usp_client_onsite_search"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("maxRows",adInteger,adParamInput,4,10)
.Parameters.Append .CreateParameter("Firstname", adVarchar, adParamInput,50 , vbnull)
End With
SQL server shows this "exec usp_client_onsite_search 10,'1'"
In other words, the parameters aren't being passed according to name; they're passed according to order. And some might not be present in each call.