Best method to do bulk update (.NET)

invidia

Platinum Member
Oct 8, 2006
2,151
1
0
I'm trying to find the most efficient method of updating a SQL Server table from a .csv file. I don't think I can do a direct .csv -> SQL Server import (or can I? Not too familiar with T-SQL programming), because the .csv file structure needs to go through some modifications, ie removing/adding columns, filtering out some data, etc. I was thinking of doing this through VB.NET/C#.

The .csv range from 20-30 columns and +500,000 rows. I'm looking to replace or update tables with this data and not add more to it (insert).
 

Train

Lifer
Jun 22, 2000
13,863
68
91
www.bing.com
There's a million ways to skin that cat.

Do you have SQL Management Studio? The built in Import/Export wizards are pretty good.

Usually in a case like yours I would just do a raw import to a new table, do the needed massaging there, then copy over to the destination table. delete the import table afterwards if you want.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Yeah, what Train said. The Data Import/Export wizard in SQL Management studio is very powerful, and it can handle really large files. I've used it to import flat files with over a million rows. It has some quirks and getting the column types set up correctly can be a pain sometimes, but it works. And then GeekDrew's question is a very good one as well, because if this is recurring other solutions might make more sense (i.e. write a small process to import the rows into a temp table and then kick off a stored proc to finalize it, and schedule the program).
 

linkgoron

Platinum Member
Mar 9, 2005
2,334
857
136
You could also look at SSIS (sql server integartion services). I've used it more than once for importing and exporting.
 

invidia

Platinum Member
Oct 8, 2006
2,151
1
0
Is this one-time or recurring?

It's recurring. I'll take a look at the importing functionality of the management tool. I haven't used any other features of SQL Server Management tool except for creating DBs and doing queries.
 

Train

Lifer
Jun 22, 2000
13,863
68
91
www.bing.com
It's recurring. I'll take a look at the importing functionality of the management tool. I haven't used any other features of SQL Server Management tool except for creating DBs and doing queries.

One nice thing about the import wizard is that once you are done setting up your import, you can save it as a DTS package, so you won't have to go through the trouble of configuring it the next time you want to use it.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |