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)
 need help with dts package

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-10 : 08:20:56
marcus writes "am using a dts package to move data from a .txt file to
a data table. In that file, there are two columns of
information that I need to combine into one column in the
table. here is an example:

col1 col2
xyz123 <null>
xyz234 <null>
<null> abc333
<null> abc757

If every instance, if there is a value in column 1 there
will be a <null> in column 2. The same is true in the
reverse. I want the data in the table after the move to
look like this:

combined
column
xyz123
xyz234
abc333
abc757

However, when I do the transformation, the package appends
the word null to the field. so my actual data looks like
this:

actual
xyz123null
xyz234null
nullabc333
nullabc757

Here is the activex script:

//*********************************************************
*************
// Java Transformation Script
//*********************************************************
***************

// Copy each source column to the destination column
function Main()
{
DTSDestination("CLO") = DTSSource("Col009") +
DTSSource("Col010");
return(DTSTransformStat_OK);
}

Help!! Marcus
."

dhw
Constraint Violating Yak Guru

332 Posts

Posted - 2004-06-10 : 14:51:11
I generally use vb for my DTS scripting...but I have successfully used IF/ENDIF block for this type of data, and it works great.
Go to Top of Page
   

- Advertisement -