Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Practice For Mass Updates

Status
Not open for further replies.

Schimsky

Programmer
Oct 4, 2003
23
0
0
US
Hi,

Hypothetically, If I had a database with a table that had millions of records in it, and I wanted to update a field in every one of those records. Would I create a dataset of the table, (millions of records), then parse through the dataset updating the field, then update the table with the dataset?

To me, this seems as if it would be extremely hard on system resources and possibly take a very long time. Is there a better way to do HUGE BATCH STYLE UPDATES???

Steve
 
Can you use just a regular SQL Update statement but don't include a where clause?


Update Foo set Pay = Pay * 2


This would double the pay field in table foo



Scott
Programmer Analyst
<{{><
 

stnkyminky,

That is a good suggestion. I wouldn't of thought to do that.

Finding ways to avoid creating such a large DataSet Table seems to be the answer.

Thanks for the suggestion.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top