Multiple Comma Separated Help

  • Hi all. Please advise how i can solve these two problems. Thanks. in advance.

    1)My source field has datatype (Text) and my destination table, Field, Datatype is (Varchar(30), I tried to change data type through “Data Conversion” Transformation but he didn’t let me. Please help me.

    2)I have source table fileld like this

    SOURCE FIELDSTARGET FIELDS

    CONT_CVARCHAR(50)LIC_G1 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G2 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G3 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G4 VARCHAR(10)

    NOTE:- MULTIPLE COMMA SEPARATED ENTRIES, SEPARATE OUT "B,C8,61,17"

    Left side is my source Fields, and right side is my target fields.

    Cont_Classes has data something like this.

    B,HIC

    B, C2, C13

    B, C2, C13,G1

    AND SO ON.

    I Want “B” go Lic_G1”

    “C2” go Lic_G2”

    “C13” go Lic_G3”

    “G1 go Lic_G4”

    Could you please tell me how I can do this one in SSIS?

  • Sounds like you need to use a Conditional Split

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Thanks for prompt reply. You are 200% right. I need help in expression):.

  • jscot91 (11/1/2010)


    Hi all. Please advise how i can solve these two problems. Thanks. in advance.

    1)My source field has datatype (Text) and my destination table, Field, Datatype is (Varchar(30), I tried to change data type through “Data Conversion” Transformation but he didn’t let me. Please help me.

    2)I have source table fileld like this

    SOURCE FIELDSTARGET FIELDS

    CONT_CVARCHAR(50)LIC_G1 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G2 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G3 VARCHAR(10)

    CONT_CVARCHAR(50)LIC_G4 VARCHAR(10)

    NOTE:- MULTIPLE COMMA SEPARATED ENTRIES, SEPARATE OUT "B,C8,61,17"

    Left side is my source Fields, and right side is my target fields.

    Cont_Classes has data something like this.

    B,HIC

    B, C2, C13

    B, C2, C13,G1

    AND SO ON.

    I Want “B” go Lic_G1”

    “C2” go Lic_G2”

    “C13” go Lic_G3”

    “G1 go Lic_G4”

    Could you please tell me how I can do this one in SSIS?

    For better help, please see the first link in my signature line below.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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