Concatenate string in DTS package

  • I'm trying to concatenate the value of 2 varchar fields in the DTS source to a single field in the destination. Example: Select Lname + ', ' + Fname as Name. I'm getting an error that the + token is invalid. It works fine in query analyzer. What am I missing?

  • If you are writing the code as part of an ActiveX script, the & character is used to concatenate strings, not + (just to keep you on your toes)!

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • It was in a "copy column" task. I had tried using the & character also but it failed. I think the problem might be that my source is a DB2 table and the SQL must not support concatenation with its fields. I'm not familiar with the ActiveX script, but maybe I'll look into that and see if I can get it to work that way.  Thanks.

  • Dan,

    You could import into a "staging" table with separate name columns, then concatenate as you move the data from there to your "real" table.

    Greg

    Greg

  • Thanks Greg. That's the solution I'll use!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply