Hi Folks,

When doing multiple inserts on SQL2K, any reason you shouldn't do this:

<cfquery name="qTestIns" datasource="mydb">
insert into mytable (columnname) values ('a')
insert into mytable (columnname) values ('b')
</cfquery>

as opposed to this:

<cftransaction>
<cfquery name="qTestIns" datasource="mydb">
insert into mytable (columnname) values ('a')
</cfquery>
<cfquery name="qTestIns" datasource="mydb">
insert into mytable (columnname) values ('b')
</cfquery>
</cftransaction>

I've noticed that the short version rolls back the first insert statement
if there's a problem with the second statement.

Does it also perform the inserts as an atomic transaction? ie. If 2 users
hit this code concurrently, will it ensure that one user's inserts finish
before starting on the other's?

TIA

Tim


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to