Solved

Microsoft SQL server 2005 updating 2.5 million records fails

Posted on 2009-04-13
2
250 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
Comment Utility
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
Comment Utility
now I feel real dumb I was doing it in the open table window.
thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

10 Experts available now in Live!

Get 1:1 Help Now