As noted, it is not an true SP in the way you have a pre-compiled set of SQL
(it is not stored within the DB itself)- it is straight forward dynamic SQL.


What version of SQL are you running? When you run a trace (not on a
production server) you get a choice of what columns/params you want
log...they can be as deep or as limited as possible....look at the Trace
Settings/Options and see what you are actually logging,








-----Original Message-----
From: Billy Jamme [mailto:[EMAIL PROTECTED] 
Sent: 18 July 2006 16:01
To: CF-Talk
Subject: Re: Using SQL profiler with cfqueryparam

>This is not an SP per se, it is just how SQL handles these dynamic SQL
>strings.
>

Upon further research this is a SP.  

I pulled the following from Ray Camden's blog.

So this:

<cfquery name="getUser" datasource="#dsn#">
      SELECT    name, Email, userId
      FROM   users   
      WHERE   username = <cfqueryparam cfsqltype="CF_SQL_CHAR" value="joe">
      AND      pin = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="5555">

</cfquery>

Translates into this:

<cfquery name="getUser" datasource="#dsn#">
   DECLARE   @param1 varchar(50)
   DECLARE @param2 int = 5555
   
   set @param1 = 'joe'
   set @param2 = 5555
   
   SELECT    name, Email, userId
   FROM   users   
   WHERE   username = @param1
   AND      pin = @param2
</cfquery>

So once the declares are called, it's assigned a dynamic handler in SQL (for
illustrative purposes handle number 8).  Then calls to this query is handled
by exec sp_execute statement.   Now here's where I'm a bit confused.   So in
this example would ColdFusion call: exec sp_execute 8, 'joe', '5555' 

Or would Coldfusion call the about <cfquery> declaration & SQL server is
dynamically attributing the exec sp_execute statement?   Or is something
else happening.  

I'll do some more research on this & post the results.  But if anyone else
knows, please feel free to point me in the right direction.

--bj



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246888
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to