SQL Server handles that for you....in nutshell; but good practice would have any have any and all updates within transactions.
And the fact remains, if you do not have a LastUpdatedate column you have no way of knowing. -----Original Message----- From: Andy [mailto:[EMAIL PROTECTED] Sent: 25 November 2005 15:49 To: CF-Talk Subject: RE: "NoLock" in SQL Server Wasn't thinking about 2 concurrent updates, just one person updating between the select and second update. Question, if 2 update requests happen at exactly the same time: Update table Set LastUpdateDate=Timestamp, .... Where KeyId= <whatever the record key is> AND LastUpdatedate=<value from select> What settings would need to be used to ensure that one of the updates failed. Andy -----Original Message----- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, November 25, 2005 9:15 AM To: CF-Talk Subject: RE: "NoLock" in SQL Server Well, two problems their - there is no system procedure for that (I think you can do it in Cubes however) it would only work if you have a column which registers that value - and even then it is not a true and accurate metric as a nolock would ignore any concurrent updates which may be in a transaction - so you may or may not get the most recent record. -----Original Message----- From: Andy [mailto:[EMAIL PROTECTED] Sent: 25 November 2005 15:20 To: CF-Talk Subject: RE: "NoLock" in SQL Server One way around the snapshot problem is to use LastUpdateDate as part of the where clause in the update. Andy -----Original Message----- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, November 25, 2005 9:03 AM To: CF-Talk Subject: RE: "NoLock" in SQL Server I could say it is better practice to use READ UNCOMMITTED than NOLOCK (I think they are classed as one in the same) within a query. You should not get a race condition no (well, not in the way you mean), what you will get is a snapshot of the data during a select which may contain information which as been updated during the time it took to get the data back to the client - for a web application or table which is frequently updated it not a good idea to use READ UNCOMMITTED or NOLOCK as you will undoubtedly want to have the latest information available to you. Imaging that if you have NOLOCK that you are saying - give me all this info and I don't care if it is being updated.... N -----Original Message----- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: 25 November 2005 14:52 To: CF-Talk Subject: SOT: "NoLock" in SQL Server Since there's a couple of SQL Server gurus on here I thought I'd pose this here. At my old employer, one the developers swore by using the term "with nolock" in all of his SQL queries, I understand that this bypasses SQL Servers automatic record locking and it does improve speed. But this practice sets off alarms in my head, because it just seems like a bad thing to do. Wouldn't this set up race conditions on the SQL Server? If anyone has any insight I'd appreciate it. Thanks sas Scott A. Stewart ColdFusion Developer GNSI 11820 Parklawn Dr Rockville, MD 20852 (301) 770-9610 This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225245 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

