Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing from text file to database

Status
Not open for further replies.
Feb 9, 2003
24
AR
I'm trying to import from a text file directly into the database. I'm useing a transform data task to do this task, however it's not working correctly. When that portion of the dts package runs, it imports the data into the database but does it 7 times. Is there any way to get it to import it only once?
 
Do you truncate the table or delete the data before importing? Or did you leave the default setting and append the data to the table? I have never seen the import behave as you describe. I suspect you ran the package multiple times (7?) and the data was appended. If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
well it seemed to fix itself :-\. I ran it again and it worked fine. However I have noticed a new problem. Here is what I'm doing. If there is a better way please help me. Basically I'm importing from two files, running a query on that information and inserting that query into another table.

I start off with two ftp imports. Each ftp basically gets one file. From each ftp I have it doing the mapping of that data from the txt file it just imported into the database. So it basically does a V from the two ftp -> text file(destination) -> database. Two starting points converging onto one database. Then I'm trying to go from that one database to multiple queries using inserts. My problem now comes to geting the DTS package to run those last queries. I have them set to run after completion of the data transform task for the coresponding file import.

I hope this makes sense. Should I do both files together in one DTS package, or should I do two DTS packages?
 
Your scenario is very common. A DTS package can FTP the files, import into SQL tables and then manipulate the data using SL Statements. I'm unclear from you explanation what is going wrong. DO you get eerors, no input, invalid input, incorrect workflow in the DTS package?

The setup is very simple using the DTS pacakge designer. You need to confirm all workflow precedences are properly setup. If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top