Does anyone know how to convert this cfquery to TSQL so it can be executed 
through a stored procedure instead in MS SQL 2000? The first condition just 
sees if a var exists and makes sure its not null, the second one does the same 
thing but feeds the query a list:

<cfquery name="test" datasource="abcinc">
select *
from profiles
where 0=0
<cfif isdefined('form.firstname') and form.firstname neq ''>and 
firstname='#form.firstname#'</cfif>
<cfif isdefined('zipsreturned') and zipsreturned neq ""> 
and zipcode in (<cfqueryparam cfsqltype="cf_sql_varchar" value="#zipsreturned#" 
list="yes">)</cfif> 
</cfquery>

I'm having a tuff time creating the condition in the WHERE part to check if the 
variable form.firstname exists first, and then to make sure its not null. 

I'm trying to build a search form and then have the search criteria queried in 
a MS SQL Server stored procedure directly for the sake of speed.

I appreciate any help. Thanks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195797
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to