cyberbiker
Programmer
Is it possible to create an optional input parameter in a stored procedure with a default value?
ie: if no parameter is passed I want the value to be -1.
I feel certain that I can now write a stored procedure that checks for a null value or a zero and then do this or that if the value is null or 0, but really need to know if there is a way similar to declaring a functions argument as optional in VB available in T-SQL
Also, is it possible to pass a parameter to a stored procedure by using the connection.execute method?
My understanding is that it is not possible to pass a parameter using the connection.execute method and that I need to create a command object instead.
However, we have a "brilliant" individual here who insists that I can pass a parameter using the connection.execute method. He has the ear of management who takes what he says as if passed from the mount. I now need to either find a way to pass an optional parameter from a connection object or find a darn good explanation as to why it cannot be done.
Help will be greatly appreciated.
Terry (cyberbiker)
ie: if no parameter is passed I want the value to be -1.
I feel certain that I can now write a stored procedure that checks for a null value or a zero and then do this or that if the value is null or 0, but really need to know if there is a way similar to declaring a functions argument as optional in VB available in T-SQL
Also, is it possible to pass a parameter to a stored procedure by using the connection.execute method?
My understanding is that it is not possible to pass a parameter using the connection.execute method and that I need to create a command object instead.
However, we have a "brilliant" individual here who insists that I can pass a parameter using the connection.execute method. He has the ear of management who takes what he says as if passed from the mount. I now need to either find a way to pass an optional parameter from a connection object or find a darn good explanation as to why it cannot be done.
Help will be greatly appreciated.
Terry (cyberbiker)