Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-03-14 : 07:27:39
|
| Bill writes "Thanks in advance.I am running SQL Server 2000 on a W2k Server.I have, on a daily basis, flat files with a record count ranging from 2000 to 11,000 records. VB.NET is used to iterate through each file and manipulate the data as needed. When it is all said and done, I need to INSERT or UPDATE these records into a single table.(INSERT if its a new record, UPDATE if record exists)My question is; what would you recommend as the best practice for large updates? I have used stored procedures as well as 'IF EXISTS/INSERT/UPDATE' statements, but I find myself sending one record at a time and performance is lacking.Any direction would be greatly appreciated.Thank You,Bill" |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2003-03-14 : 12:44:17
|
| I think rather than doing this from your front end, record by record, you'd be better off dumping your data into a storage table then processing it on the sql side. This will let you leverage more of a set based approach. When you're done with, for example, your updates, then delete those records from your storage table then you know the rest are inserts. This should go quite a bit faster.Mike"oh, that monkey is going to pay" |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-03-14 : 19:47:24
|
| DID YOU JUST USE THE WORD "LEVERAGE"???? WTF IS THE MATTER WITH YOU????? ARE YOU A MANAGER NOW OR SOMETHING??? |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-03-14 : 19:47:36
|
quote: This will let you leverage more of a set based approach
eewwwwwww, you said the "L" word.Next thing you will be in marketing DamianEdited by - merkin on 03/14/2003 19:48:23 |
 |
|
|
|
|
|
|
|