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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import from CSV file.

Author  Topic 

sonu
Posting Yak Master

110 Posts

Posted - 2005-01-17 : 14:19:38
Hello,

I need to import data from a csv file to a table via a dts. The CSV looks simply like this:

1,2,3,4,5

However I need to format the data before I can import it to a table. So I thought that I could import it to a temp table, do the changes there and import the temp table with the database tables. I would like to know if this idea will work and if somebody could guide me through that. I have never worked with a DTS. Any help or suggestion is appreciated.

thanks

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-17 : 16:41:44
Why do you want to use dts?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-01-18 : 15:37:13
Yes the idea will work, but as nr alludes to you might also want to look into using BCP or OPENQUERY. And if your file really is as simple as your example (one row, five fields) then why is that in a file? Isn't there some easier/better way to get the information you are looking for?

DTS is a big enough beast that we can't really walk you through all the steps. It's time to dive into BOL (SQL Server Books On-Line) or just start playing with DTS (if you are committed to going this direction). It will require several steps as you have already outliend: Import into a working table, make changes, Insert from working table into final destination table, purge from working table.

---------------------------------------------------------------------------------
Infoneering: Information Technology solutions engineered to professional standards.
Go to Top of Page
   

- Advertisement -