Un-Concatenation (if that is a word)

  • Hello,

    I will be receiving files on a regular basis and they are in Excel format and have several columns of data.

    I will be importing them into a table that also has several columns.

    The problem I am facing is that one of the columns in the table contains concatenated data. The column in question will contain Nameofcertification|datecertified|datecertexpires, Nameofcertification|datecertified|datecerexpires

    This column can contain one or more of these groupings or it may contain null or be left blank.

    I need a way to parse this text and place each item into it’s own column such as a column for certifications, a column for datecertified, and a datecertexpires column.

    I am using TSQL and I am hoping someone can provide an example for me to follow.

    Thanks

    Gary

  • Take a look at these two articles by Erland Sommarskog:

    http://www.sommarskog.se/arrays-in-sql.html

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

  • If you really want help, refer to the following article...

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    --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)

  • ...almost forgot... the "words" you're looking for are "Parsing a delimited column".

    --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