Just for fun, here's some examples of what SQL Server receives from
coldfusion when you run a pretty simple query using cfqueryparam:

declare @p1 int
set @p1=748592
exec sp_prepexec @p1 output,N'@P1 int,@P2 bit',N'select
gallery_link_id, gallery_link_name
        from gallery_links
        where class_id = @P1
        and active = @P2
        order by sort',8806,1
select @p1

This exec sp_prepexec shit is one reason why, if you're writing an app
that needs to scale, you probably ought to actually write your own
stored procedures rather than letting CF do this kind of thing

what's interesting is that I've found cases where I'd run my "query"
in SQL Server Management studio, and compare the execution plan to a
query like the one that SQL Server actually executes (above) and find
that they're different sometimes.

So writing your OWN stored procedure is the only way to be sure that
the database server is doign exactly what you think its doing (or what
you want it to do).

rick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337473
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to