I have to create a store procedures which has four parameters lets say a,b,c and d.
Condition: User won't pass the values for all these parameters - sometimes its onlly a and b and sometimes it is a,b and c.
I know I can pass default value to the parameters but I don't have any default value for these parameters. Only way I can think of doing it is using if else conditon : like if a = 123 and b = 345 then execute code, else a = 123 and c= 567 and d = 234 but to do this i have to write if else 15 times for different combination:
a b c d
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
1 1 1 1
Is there ay better way to do this?
thanks for your help!!