Help. My UPDATE steatment is running since yesterday

  • 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...

  • 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


    Madhivanan

    Failing to plan is Planning to fail

  • 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.

  • Thank you all for you replies

    and thank you very very much Madhivanan, it worked for me and its done :kiss: 🙂

  • eslam.amgad (12/9/2009)


    Thank you all for you replies

    and thank you very very much Madhivanan, it worked for me and its done :kiss: 🙂

    Thanks for your feedback and you are welcome 🙂


    Madhivanan

    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