Solved

Microsoft SQL server 2005 updating 2.5 million records fails

Posted on 2009-04-13
2
264 Views
Last Modified: 2012-06-21
I am trying to update 2.5 million records and I just time out after about 30 seconds.  I am on the server itself using the management studio I was to update a null field based on another field here is the query.  I am then going to need to loop or use a cursor to iterate over each record and look it up in a table to pull the state and timezone for each area code.  It this a time out issue or on index issue or am I just doing something dumb?


UPDATE    CallRecords

SET              AreaCode = RIGHT(LEFT(PhoneNumber, 4), 3)

WHERE     (AreaCode IS NULL)

Open in new window

0
Comment
Question by:TSN_Admin
2 Comments
 
LVL 16

Accepted Solution

by:
brad2575 earned 250 total points
ID: 24130431
Are you running this in a "New Query" window?  Or using the "Open Table"?  If you use the "New Query" window it should work.

If not then you have to change your timeout.  Do this by going to:
    Tools - Options - Query Execution (select from left side)

Then make sure "Execution Timeout" is set to "0" (unlimited).

You should be able to do your other updates all in the same script as well with joins or user defined functions.
0
 

Author Closing Comment

by:TSN_Admin
ID: 31569526
now I feel real dumb I was doing it in the open table window.
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now