I need a rather advanced query that transforms data from a table to a specified format. I am providing a screenshot of the initial and desired formats. Oh, and there are several thousands of records here, so any cursors enumerating over 100 times cannot be used due to performance. Original table: Desired result: Note that 'characteristic x name' is not the same for each item, as the number of characteristics can be different per each item. The order of characteristics is not important, but if an item has 3 characteristics, they must occupy spots 1 through 3. Myself I was only able to do it with cursors (slow), my colleague did it with clr/.net (not recommended). Many thanks in advance.