• Do you have a Numbers table? (Or Tally table, or whatever else you want to call it.)

    If so, then you can use a string parsing query in a cross apply to split up the pairs, then another to split up the names and values, then pivot that. Do the whole split functionality in a CTE, and the pivot in the final, outer select, and you could have a view on it. You just have to predefine the valid values for the name part of the pairs, and build those into your pivot statement.

    Are you familiar with Cross Apply, and with Numbers-based string parsing?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon