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 .csv files

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-11-02 : 07:48:02
Tim writes "I am importing a directory of csv files into sql server 2000. Each file is the import as a single record. The problem is that some of the fields in the files contain more than one entry causing extra records to insert into the table when only one record should import for each file. Any suggestions or existing stored procedures to handle this?"

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-02 : 07:49:33
Use TOP 1 to get only one record.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-11-02 : 08:13:40
bulk insert into a single column temp table then parse the data from there.
Then you can deal with the multiple entry fields.

==========================================
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
   

- Advertisement -