[thelist] To Store or Not to Store - Building dynamic queries

Casey Crookston caseyc at IntelliSoftmn.com
Mon Aug 14 16:25:34 CDT 2006


> if @param1 > ''
 
No, you can't do math on a string like that.  (greater than space?)
....
if @srchtype = 'books'

~~~~~~~~~~~~~~~~~

Okay okay.... I need to check if a parameter has a value.  I can't
hardwire a value into this stored proc.  I'm not checking for a specific
value, I'm checking to see if is has ANY value.

If a user fills in the "city" field for example, we need to include this
into the WHERE clause:

'AND city like @city'

How do you check for a value in a stored proc?  

Maybe: If @city IS NOT NULL?
 





More information about the thelist mailing list