December 8, 2009 at 2:37 am
Dear all,
I have 2 databases on the server, I need to update a table in the 1st db with data from another table in the 2nd db.
The update query will update over 2,000,000 records.
I made an update querey which is still running from yesterday :w00t: !!!
Please help :crazy:
the query:
update corpus.dbo.solution set sol_num=(select top 1 number from corp.dbo.buckModifications
where corp.dbo.buckModifications.arabic_vocalization = corpus.dbo.solution.sol_arvoc and
corp.dbo.buckModifications.stem = corpus.dbo.solution.sol_stem and
corp.dbo.buckModifications.lemmaid = corpus.dbo.solution.sol_lemmaid)
The select in the sub query is selecting from a table with about 1,000,000 record.
Is there anything wrong or i shoud wait???
Thanks in advance...
December 8, 2009 at 6:59 am
Stop that query and try this
update
s
set sol_num=b.number
from
corpus.dbo.solution as s inner join corp.dbo.buckModifications as b
on b.arabic_vocalization = s.sol_arvoc and
b.stem = s.sol_stem and
b.lemmaid = s.sol_lemmaid
Failing to plan is Planning to fail
December 8, 2009 at 7:10 am
Do you update all the records in one operation? If yes, you should consider updating in small chunks.
Check if any locking occurs, see http://jmkehayias.blogspot.com/2008/12/troubleshooting-locking-in-database.html.
Is there any error message in your SQL log?
I'm not sure I fully understand your query - you specify "TOP 1", however here is no ORDER BY (?)
Indexing should also be checked.
December 9, 2009 at 12:43 am
Thank you all for you replies
and thank you very very much Madhivanan, it worked for me and its done :kiss: 🙂
December 9, 2009 at 11:41 pm
eslam.amgad (12/9/2009)
Thank you all for you repliesand thank you very very much Madhivanan, it worked for me and its done :kiss: 🙂
Thanks for your feedback and you are welcome 🙂
Failing to plan is Planning to fail
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply