What is the best method of handling null parameters in stored procedure ?
I have a stored procedure with 3 input parameters, any one of them parameter can be null so how to handle those parameter.
SP_GetDetails input parameter (varchar p1, varchar p2, int p3, datetime p4, datetime p5)
In the stored procedure, there are different query based on input parameters.
if(p1<>null)
///
else
if(p2<>null)
///
else
if()... so on...
So my question: Is it good to have n number of if condition.