Hi Barry,executing StoredProcs are always faster than executing inline SQL (in the code) - for the same query
You should write it like this... <cfquery name="qGetEmp" datasource="xyz"> SELECT * FROM Employees WHERE EmployeeID = <cfqueryparam value="#x#" cfsqltype="CF_SQL_INTEGER"> </cfquery>
There are 2 benefits to writing dynamic SQL this way - 1. It allows you to validate that your dynamic variable is the right datatype. Very important if it's a URL or Form variable 2. Any decent database (SQL Server, Oracle) will compile the first part of the SQL statement and subsequent calls will be faster.
Just to add to what Tim said ;) -- you can't use dynamic query cacheing if you use CFQUERYPARAMs So you need to make that decision up front before you implement either.
-- geoff http://www.daemon.com.au/
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
