This must be a very basic question. Lets say we have a stored procedure:
Now we want the procedure to be able to take a dummy value which tells the sp that it needs to handle the request differently from when an integer 'someId' is passed in. How is this kind of situation normally handled?
Sharad, I favor creating another stored procedure that does the other thing and calling that. This is similar to the non-database task of having a Java method do something different. Messing with the parameters (either as nulls or magic number values) makes the code more confusing to call and harder to maintain.