Groups | Blog | Home
all groups > sql server (alternate) > october 2004 >

sql server (alternate) : Updating from a Text File?


steveosit NO[at]SPAM gmail.com
10/27/2004 8:44:29 AM
Hi All,

I'm not that great with MS-SQL, as I never really have any occasion to
use it. However, I need to get this one thing working and don't have
a clue where to start.

I have a comma-delimited file that's delivered to the server every
night that contains updates to one of the tables. I'm trying to
create a DTS package that will read in the text file and update all of
the records contained in it, rather than simply append them to the
bottom of the table (resulting in duplicate entries).

I know how to schedule it and such, but if anyone can give me some
tips on the design of the DTS package, it would be much appreciated.

Thanks!

Little PussyCat
10/27/2004 9:55:20 PM
[quoted text, click to view]

I've never attempted this myself but I know that BCP and Bulk insert may be
what you need.
I cannot give you any more clues than that as I have never had to look into
it myself but I'm sure if you search Google on BCP and bulk insert you will
find what you need.

Erland Sommarskog
10/27/2004 10:23:11 PM
S. Osit (steveosit@gmail.com) writes:
[quoted text, click to view]

I don't know DTS, so I can't help on that part. I would use BCP to load
the file into a staging table, and then update the target table from
there. Having some process read each row and then look it up in the target
table will not be effective.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
ryanofford NO[at]SPAM hotmail.com
10/28/2004 12:48:10 AM
www.sqldts.com

[quoted text, click to view]
AddThis Social Bookmark Button