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 2005 Forums
 SSIS and Import/Export (2005)
 Load text files in to tables

Author  Topic 

on7june
Starting Member

41 Posts

Posted - 2007-10-15 : 09:33:31
Hi all,

I have around 140 text files in a folder where all the file entries are delimited by tabs. Currently i am copying the data and then pasting it in to the tables and it is perfectly working fine. I have already created tables for those 140 files. But now i want to load those files in to the table at a single shot. How can i do it? I am using SQLServer 2005.

Sarvan

nr
SQLTeam MVY

12543 Posts

Posted - 2007-10-15 : 09:45:28
Easiest to use bulk insert if the table structuers match the tables.
Just have a table which holds the file masks and table names and loop through it.
Have a look at
http://www.nigelrivett.net/SQLTsql/ImportTextFiles.html

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

on7june
Starting Member

41 Posts

Posted - 2007-10-15 : 10:32:39
Hi Nigel Rivett,

Thank you for immediate response. Will try and let u know if there is any queries.

Sarvan
Go to Top of Page
   

- Advertisement -