> <cftransaction> > > do insert > > select max(id) > from table > > </cftranascation>
Couldn't this set a page level lock (or possibly a row level lock in SQL Server 2K)? That would still allow another user to add a row in between. You'd probably have to do something like: <!--- serializable should hold the lock throughout the transaction (i think.. otherwise, specifiy HOLDLOCK with TABLOCK)---> <cftransaction isolation="serializable"> <!--- Can anyone confirm this locking hint syntax? BOL didn't give a good example ---> <cfquery> INSERT INTO myTable WITH TABLOCK (..., ...) VALUES (..., ...) </cfquery> <cfquery> get max </cfquery> </cftransaction> Ben Johnson ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists