Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update statement

Author  Topic 

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-07-16 : 05:30:21
Hi,

I've an update statement that will change a number of rows

UPDATE t SET t.dq_flag = mc.flag
FROM DQ_RawBinMedianCheck AS mc
INNER JOIN trade t ON t.vendorcodeid = mc.vendorcodeid
AND t.tdate = mc.tdate
and t.dq_flag <> mc.flag

I've made the assumption that all the records being changed will be locked until they are all changed, is that correct?

I don't want another process to be able to get hold of any updated rows before they are all updated, if that makes sense.

Sean

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-16 : 05:32:10
All touched records are locked until UPDATE statement is done.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-07-16 : 05:38:06
Thanks

Sean
Go to Top of Page
   

- Advertisement -