I don't know what CF9 is doing under the hood.  What I do is put all the
queries in stored procedures. At the beginning of the procedure I always
put SET NOCOUNT ON and I always end with SET NOCOUNT OFF.

If you have a procedure that is doing a lot of stuff it can reduce a lot
of back and forth and network traffic.

I had one procedure that did a lot of data pulls and combining of data,
without using the nocount, the amount of messages about xx rows affected
was way larger than the actual data that was returned. Sometimes it's
the other way around.  When I'm testing something I leave them off so I
can see what is happening. 

Think of it sort of like turning off debug in production for cf. It's
not really critical data, but if you don't do it you get a lot of
overhead.

Steve

-----Original Message-----
From: Michael Dinowitz [mailto:mdino...@houseoffusion.com] 
Sent: Friday, January 29, 2010 9:37 AM
To: cf-talk
Subject: Re: CF9 cfquery not giving same insert results as CF7


Thanks. This gives me a bit of extra information on top of the
research I've done on the topic. Now comes a few extended questions.
:)

1. When a cfquery has a result attribute defined, it will return data
about the query and in the case of an insert, the id of the inserted
item. The assumption is that under the hood CF is using
scope_identity() (for MSSQL). Do you have any idea if this is the
case? Just trivia and something I should test anyway.
2. From what you say of NoCount, I assume that there would be a minor
performance benefit for sql insert, update, and delete operations to
use it, correct?

Thanks

--
Michael Dinowitz


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330256
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to