Home Forums SQL Server 2008 T-SQL (SS2K8) Help needed to decode comma delimited string and insert into tables RE: Help needed to decode comma delimited string and insert into tables

  • JJH82 (2/20/2011)


    thanks kumar20, you code is working, However, I forgot to mention the fact that new value and old value can contain multiple words.

    e.g. "new value" "Old value"

    I am modifying your code to suit my needs. I will test the performance after that. 🙂

    ---------------

    updates: there is a logic error, when there are equal number of field and colummn changes, the procedure will ignore the column changes.

    I suspect that it is caused by MAX().

    sample string 3:

    ,1 Field_Name "F3", 1 New_Field_Name "F3", 1 Old_Field_Name "f3" ,1 Column_Name "Col6" ,1 New_Column_Value "F", 1 Old_Column_Value "f"

    If you're getting an error, please post your code.

    If you want really good answers, please post your data possibilities in a readily consumable format. Don't assume that you know how to do that. 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)