> Moreover, a better solution would be something like this > (assuming SQL Server): > > <cftransaction> > <cfquery name="qInsertData" datasource="#APPLICATION.dsn#"> > INSERT INTO t_doctors (#ColNames#) > VALUES (#preserveSingleQuotes(ColValues)#); > SELECT SCOPE_IDENTITY() AS newpkey; > </cfquery> > </cftransaction>
Using CFTRANSACTION in this example doesn't really accomplish much. Any individual query is already a single transaction. The only possible value of using CFTRANSACTION around a single query is to change the isolation level of that query/transaction. In this particular case, that wouldn't accomplish anything, since the SELECT statement will already return the newly inserted key no matter what the isolation level is. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236895 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

