Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Importing multiple files to SQL

 
   Database Forums (Home) -> General Discussions RSS
Next:  working with daily results : results per day  
Author Message
chudson007

External


Since: Mar 10, 2005
Posts: 7



(Msg. 1) Posted: Fri Aug 05, 2005 3:51 am
Post subject: Importing multiple files to SQL
Archived from groups: comp>databases>ms-sqlserver (more info?)

I have over three hundred text files that I need to import to SQL
Server.
Each is in the exact same format.
I want to import tham as seperate tables.
Is there any way to do it in one process?

Regards,
Ciarán

 >> Stay informed about: Importing multiple files to SQL 
Back to top
Login to vote
shumaker

External


Since: Apr 12, 2005
Posts: 7



(Msg. 2) Posted: Mon Aug 08, 2005 11:29 am
Post subject: Re: Importing multiple files to SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I use the above method, but if you want seperate tables:

You could add in dynamic properties and some scripts to the workflow of
the DTS. A script task sets a source filename dynamic property. A
create table task uses the dynamic property as the table name. Then
import into the new table from the file(again using the dynamic
properties to set the source filename and destination table name).

Using only one table will make some things much easier, and other
things harder. Consider that with multiple tables you will have to
either have a copy of all your queries for each table, or have a stored
procedure that allows the table name to be specified as a parameter. I
think it would be easier to put all the data in one table and have a
sproc that takes the code for the special column as one of the
filtering criteria. I think the syntax for specifying the criteria for
that column is no harder than specifying a table name.

 >> Stay informed about: Importing multiple files to SQL 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
importing multiple excel files - Hi I have multiple excel files of the same format in a directory. They are called book1.xls, book2.xls, book3.xls and so on. What is the easiest way to import the tab named sheet1 from each of the excel files to a databse using SQL server 2000 enterpris...

How can I produce multiple output flat files from a single.. - Hi Folks, I'm used to a UNLOAD command that allows me to dump to a named flat file the results of any SELECT statement. Hence one can build a single SQL file which contains multiple SQL statements each of which 'unloads' to its own unique file. unload....

importing a CSV file - I have a CSV file that i need to import into a SQL table. The problem is the values in the first column are not brackited in "". There are over 700K rows. Is there an easy way to fix the data or have SQL correctly import the the data? The d...

Importing from Excel problems - What do others do if you need to import excel files into SQL Server? My main problems are 1) zipcode formatting issues. If the column is a mix of zip and zip+4, I have problems retrieving all zipcodes. 2) If the last column contains NULL no information...

Need Help Importing Data from Excel to My SQL Database - Hey guys, I am trying to import data from an Excel spreadsheet into my SQL database. I am running SQL 2005. I following Microsoft's instructions for creating a linked server, and it appeared to work. However when I run this query: SELECT * INTO test...
   Database Forums (Home) -> General Discussions All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]