I've been trying to find the complete answer to this one, and I've found bits and pieces that help, but not 100% complete for my needs.
I have a large "Super Query" for the end user, where they will choose drop down boxes or enter dates or enter numbers in order to return all the records in the system to match their criteria.
I understand the need to have a default parameter value in the stored procedure. If I use '%' for string values, it successfully returns all of the values except the parameters where the filter applies. My problem is that I have other data types where I need to set up similar filters. I have int, bit, datetime, smalldatetime, and ntext.
Can anyone help me in getting the proper syntax for running a stored procedure using these data types where if they are not specified they return all of the records?
I have a large "Super Query" for the end user, where they will choose drop down boxes or enter dates or enter numbers in order to return all the records in the system to match their criteria.
I understand the need to have a default parameter value in the stored procedure. If I use '%' for string values, it successfully returns all of the values except the parameters where the filter applies. My problem is that I have other data types where I need to set up similar filters. I have int, bit, datetime, smalldatetime, and ntext.
Can anyone help me in getting the proper syntax for running a stored procedure using these data types where if they are not specified they return all of the records?