August 7, 2006 at 11:31 pm
Hi,
Currently, I am doing a vb programming that reads a text file and put the data into a specified database. My code reading the text file is Mid(strRead, value,value). This doesn't work correctly because my problem is, the text file as my source is very inconsistent with its format.
Can anybody teach how I can have a dts package reading a text document file and putting the data in a desired database with its corresponding column.I believe this will help me alot because SQL has the ability to read text delimited files and can transfer the data much faster into its database.
The design I am thinking is that, in my program, user can browse on the text file that they will upload on the server then trigger the Upload button to execute the package.
I really appreciate your help. Thanks in advance.
August 8, 2006 at 10:01 am
If the text file is has many different record and field lengths, you'll have the same problem in DTS. You could possibly import the file into a staging table with a single column long enough to contain the longest record, then parse the data into a table in you destination database. A Data Driven Query task might do the job.
See this site for information on executing a DTS package from an application.
http://www.sqldts.com/default.aspx?104
Greg
Greg
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply