In our ColdFusion 11 app with SQL Server 2008 R2. A .cfm file is using a CF component that is called with a syntax such as:
<cfscript>
objMyTable = createobject('component','components.myTable);
qmyTable2list = objMyTable.loadAllCustomers();
qresultset = objMyTable.loadCustomersResultset(form.applicant_type, form.customer_name, form.state, form.orderby);
</cfscript>
The CF component has SQL Statements such as the one shown below:
<cfquery name="result_set" dataSource="#request.dsn_name#">
select name, state from myTable #REReplace(where_clause,"''","'","ALL")#
</cfquery>
When we click a button on .cfm page, the app correctly displays data from SQL Server 2008-R2. But SQL Profiler does not catch these SQL statements. When we run the profiler on .cfm pages that are using embedded cfquery tags for sql queries (instead of CF components) the SQL profiler displays all the queries executed by the page. Question: How can we make SQL Profiler catch the queries inside the CF component?
SP:StmtCompleted
? My guess is with component it usessp_executesql
instead of simpleselect
– BiomeSP:StmtCompleted
as explained here – GisarmeSP:*
is for stored procs, the snippet above doesn't look like a stored proc. Ensure you right-click on TSQL object, and select all. – TallentUpdate
section in my post showing the events I am capturing including TSQL. – Gisarmeall TSQL
objects as shown in my updated picture above. But still no luck. I've also verified that there is NO filter that I'm using. The same profiler settings as shown above work fine when the queries are in a .cfm file instead of a .cfc file. – Gisarme