Need help with comma seperated quoted string

  • Hi,

    I am using a tool which gives comma seperated quoted string at runtime

    ex: 'uniqueidentifier1', 'uniqueidentifier2','uniqueidentifier3',......

    The string can also contain nulls ex: 'uniqueidentifier1', 'uniqueidentifier2',''

    I need to parse the input and put it into a temporary table.

    I have written a function which takes input using a temp variable @temp = " 'uniqueidentifier1', 'uniqueidentifier2','uniqueidentifier3'" .

    It is working for small number of strings whose length is less than 128 characters.

    Any help would be appreciated.

    Cheers,

    Tagore

  • Please have a look at the TallyTable article linked in my signature. It describes a pretty fast method to split a string.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Set QUOTED_IDENTIFIER OFF did the trick.

    Thanks.

  • dhanu-1026978 (1/15/2010)


    Set QUOTED_IDENTIFIER OFF did the trick.

    Thanks.

    Maybe it made it work for > 128 characters but what about performance? My recommendation would be to post the code for the function and let us have a go at it... especially if the function contains the word "WHILE" or "WITH" anywhere in it.

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