Issue:

You have a stored procedure that you allow the user to enter a NULL value for. You want to be able to pass the NULL value, and the user input to the same query script.

Resolution

/*In the WHERE clause, set your criteria*/
/*You transform the NULL parameter to the value -1*/
/*Then you make it equal to -1 so as to not pass it to the proc*/
/*Or, if a value was entered, search for it in your database.*/
WHERE ((ISNULL(@YourParam, -1) = -1) or (MyTable.Value01 = @YourParam))

� 2002 Dan Herrera
These functions may be distributed freely, but please give credit where credit is due.
And if you feel you must give credit, or have a request for a custom function/macro,
please send me a note DataMasterFla

Sign Guestbook View Guestbook

Back.

Hosted by www.Geocities.ws

1