> For starters the CF drivers won't let you attempt to execute multiple
> statements in a single cfquery like that (though I believe this can be
> changed with connection string arguments). Try moving the loop outside of
> the cfquery tags so that each query runs within a single cfquery tag.
Sure it will, as long as the statements are delimited properly. In the
case of SQL Server, you can run multiple insert/update statements
separating them with a semicolon. If I remember correctly, you are only
limited to a single SELECT result set being returned unless you're
calling a stored procedure and have defined result sets.
For example, the following query works fine:
<cfquery datasource="ds" name="getNewID">
INSERT INTO table VALUES ('some record');
SELECT @@IDENTITY AS newID
</cfquery>
<cfoutput>#getNewID.newID#</cfoutput>
--
Justin Scott, http://www.tlson.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313466
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4