I have an SP that accepts a parameter to limit, say Customer ID, but I want to make it optional. So I give it a default value. How can I make a general purpose select statement using that. I'd like to have a single statement that will work regardless of
whether they passed the value or not.
For a string I default it to '%' and then do a like in the SQL command.
I realize I could do the SQL command to a temp file and then if they passed in the value delete everything but that value but that seems wasteful and may be slow if there are lots of records.
TIA - Jeff.
View Complete Post