I am using a stored procedure to perform my logic which has 2 mandatory parameters and 1 optional parameter having default value as 0 (INT).
When i am calling the procedure, i also pass the optional parameter as 1.
On debugging the stored procedure i found that the optional parameter still takes value as 0 . I have compiled the procedure many times but no success.
Kindly help me why such random behaviour of SQL server.Also how can I solve this issue ??
asked Oct 15, 2012 at 07:07 PM in Default
I have studied and debugged the procedure and found that there was a recursive call to the same procedure where in the optional parameter was not passed during the recursive call thereby resetting its value to 0.
Thank u all for your support.
answered Oct 16, 2012 at 05:33 PM
So, you should have a procedure declaration such as:
Now, in the body of the SP, are you overwriting
Or is it the code you're using to call the SP? How are you calling the SP? From within a T-SQL Script, or an application? Either way, show us the code!
answered Oct 15, 2012 at 07:49 PM