|
Hello all, 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 ?? Thanks Tushar
(comments are locked)
|
|
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.
(comments are locked)
|
|
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!
(comments are locked)
|


You are probably overwriting the value somewhere - can you post the full stored procedure script and we will be able to help you better.