Groups | Blog | Home
all groups > sql server dts > may 2007 >

sql server dts : Multiple source columns into one destination column transformation


Wade.Graunke NO[at]SPAM gmail.com
5/10/2007 9:21:46 AM
I'm trying to map two source columns into one destination column but
it won't work. Basically my source is a CSV file that has an Area
Code field and a Phone field. I want to combine them into one field
for the destination sql table of my DTS job but it won't take.

'The following doesn't work.
Function Main()
DTSDestination("Phone") = DTSSource("Area Code") & DTSSource("Phone")
Main = DTSTransformStat_OK
End Function

But if I keep it one to one it works!

'This works.
Function Main()
DTSDestination("Phone") = DTSSource("Phone")
Main = DTSTransformStat_OK
End Function

I think the DTSSource("Area Code") field is not visible to the above
transformation between DTSDestination("Phone") and DTSSource("Phone")


I know I could create a temporary but initial destination table, dump
the CVS into this table and then run some SQL to combine the columns
and then clear and dump this into my true destination table, but
there's gotta be a better way.

Does anyone have a simple solution for this?
marion.crutchfield NO[at]SPAM tnbonline.com
5/11/2007 7:16:30 AM
[quoted text, click to view]

Are you sure the DTSDestination("Phone") field is big enough? This
should work...

Allan Mitchell
5/11/2007 8:27:48 PM
Hello Wade.Graunke@gmail.com,

What is the error you are getting that should give us more clues

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button