text separated by columns that I want to put into separate variables

  • Hi there,

    just wondering what the best way to do this is:

    I have 1 field called texttarget in my table and it is like this,

    target a,targetb, targetc, tagretd.

    What is the easiest way to extract this so it puts target a in 1 column, targetb in the next and so forth??? is there an sql function that does this

    thanks

  • Not directly, you have to write some code 🙂

    Lots of examples and performance comparisons here.

    The best way is to avoid loading data in that format to begin with, of course. If the source of the data is external to SQL Server, consider using SSIS to split the string data up before you load it.

Viewing 2 posts - 1 through 1 (of 1 total)

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