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)
 Can DTS do this???

Author  Topic 

billsox
Yak Posting Veteran

74 Posts

Posted - 2002-09-27 : 09:04:59

Hi -- I've got a flat text file in the following format:

PRODUCT_ID MARKET_ID W01_2001 W02_2001 W03_2001
1 1 345 456 567
1 2 789 890 901

I'd like to import it into a table that has the following structure:

PRODUCT_ID MARKET_ID WEEKYEAR SALES
1 1 W01_2001 345
1 1 W02_2001 456
1 1 W03_2001 567
1 2 W01_2001 789
1 2 W02_2001 890
1 2 W03_2001 901

Can a DTS package be designed to accomplish this? I know I could import the source file as is and then run a T-SQL script to transform the data into the format of the destination table but I was hoping to avoid the extra step. Any ideas?

Bill

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-09-27 : 09:43:05
Well, you can write an ActiveX transformation that can do it, but it will be SLOOOOOOOOOOOWWWWWWWWWWWWWW...

DTS'ing into a staging table and then using T-SQL to transform it will be much faster.

Go to Top of Page
   

- Advertisement -