Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can PIVOT do this ?
Message
From
18/05/2010 12:16:03
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01464982
Message ID:
01465030
Views:
37
>>Thank you! Had to tweak it a little to get it to work with my tables but it works great. I'm still pawing through it to understand the pivot bit though.....
>>As a final twist: the data I really want to put into the new table won't be the Id field but another (varbinary) field from the source table. I haven't yet worked out whether the above can be modified to do that ?
>
>I don't see why not? If you will get stuck, you can post a closer sample of what you need - I can write a dynamic PIVOT for you.

Using the same test table as before except:
DECLARE @test TABLE (Id uniqueidentifier default newID(), ColumnId uniqueidentifier, RowId uniqueidentifier, ObjectData varbinary(max))
and the 'cells' in the output table should hold the content of the ObjectData field rather than the Id field......
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform