Solved

Microsoft SQL server 2005 updating 2.5 million records fails

Posted on 2009-04-13
2
283 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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