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
 General SQL Server Forums
 New to SQL Server Programming
 Updating a big table

Author  Topic 

kumarich1
Yak Posting Veteran

99 Posts

Posted - 2007-11-16 : 08:52:51
My question is if I cancel a update query when it was running will it rollback and what is the best practice to update a big table.
TX

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-11-16 : 08:55:13
Yes it will rollback. Updating a huge number of records should be done in smaller batches to avoid contention and blocking.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

kumarich1
Yak Posting Veteran

99 Posts

Posted - 2007-11-16 : 16:02:29
quote:
Originally posted by harsh_athalye

Yes it will rollback. Updating a huge number of records should be done in smaller batches to avoid contention and blocking.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"



Thanks, I am trying to update a table which has lot of indexes, so update is taking longer time.Any suggestion on how update can be performed on highly indexed table other than doing in batches.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-16 : 16:14:56
Why don't you want to use batches? This is the recommendation for large data modifications.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -