Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
roofusthedoofus #1
Converting cfquery to TSQL stored procedure
Does anyone know how to convert this cfquery to TSQL code.
The goal is to have MS SQL 2000 run this query in a stored procedure for the
sake of speed, rather than have Cold Fusion process it.
<cfquery name="test" datasource="abcinc">
select *
from profiles
where 0=0
<cfif form.firstname neq ''>and firstname='#form.firstname#'</cfif>
</cfquery>
I'm having a difficult time creating the IF condition in TSQL in the WHERE
statement to only process the variable #form.firstname# only if it is not null.
roofusthedoofus Guest
-
Sybase stored procedure vs. CFQUERY
I have a stored procedure in Sybase using a UNION that gives me errors when trying to add an 'Order By' clause. However, if I run the same SQL in... -
Calling Multiple Stored Procedures inside a cfquery
All, I have ColdFusion page that contains a Company dropdown, a To Date and From Date and submit button The user can select an ?individual... -
How you convert this cfquery to TSQL?
Does anyone know how to convert this cfquery to TSQL? <cfquery name="test" datasource="abcinc"> select * from profiles where 0=0 <cfif... -
How u convert this cfquery to TSQL?
Does anyone know how to convert this cfquery to TSQL? <cfquery name="test" datasource="abcinc"> select * from profiles where 0=0 <cfif... -
EXEC in TSQL stored proc causes ERROR
If I fill my datagrid using a stored procedure that includes the tsql command "EXEC", the grids reader gives error "Could not find stored... -
byron1021 #2
Re: Converting cfquery to TSQL stored procedure
create proc myproc
@name varchar(100)
as
IF @name is not null
select * from profiles where 0=0 and firstname = @name
else
select * from profiles
RETURN 0
Should take care of it
byron1021 Guest



Reply With Quote

