does that retrieve the newest UUID Primary Key generated? right now, i have a dateAdded field that i sort by, to get the newest one.
tony On 4/3/06, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote: > You are correct. > > 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> > > Pete > > On 4/3/06, Rick Root <[EMAIL PROTECTED]> wrote: > > I'm looking through someone elses code and I came across this... > > > > <cftransaction> > > <cfquery name="qInsertData" datasource="#APPLICATION.dsn#"> > > INSERT INTO t_doctors (#ColNames#) > > VALUES (#preserveSingleQuotes(ColValues)#) > > </cfquery> > > </cftransaction> > > <!--- pull the pkey back out ---> > > <cftransaction> > > <cfquery name="get_new_pkey" datasource="#APPLICATION.dsn#"> > > SELECT @@identity AS newpkey > > </cfquery> > > </cftransaction> > > > > > > having the queries in separate transactions doesn't do anything at all, > > does it? Wouldn't the whole thing need to be wrapped in cftransaction > > for it to be effective/ > > > > Rick > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236858 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

