Solved

Microsoft SQL server 2005 updating 2.5 million records fails

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Testing connection to sql 7 60
Stored procedure 4 32
Problem with SqlConnection 4 170
How to write a sql query returning a result  with my date time template? 8 41
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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