Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Manipulate Horizontal Hierarchy with UNPIVOT Expand / Collapse
Author
Message
Posted Thursday, December 20, 2012 3:45 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 9:35 AM
Points: 313, Visits: 167
Comments posted to this topic are about the item Manipulate Horizontal Hierarchy with UNPIVOT
Post #1398888
Posted Tuesday, January 15, 2013 11:37 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:30 PM
Points: 2,340, Visits: 3,169
You might want to look into using the CROSS APPLY VALUES approach to UNPIVOT (see the first article in my signature links). I find it much more readable that multiple UNPIVOTs and it seems to perform better as well.


No loops! No CURSORs! No RBAR! Hoo-uh!

INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?

Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Are you too recursively challenged?
Splitting strings based on patterns can be fast!
Post #1407622
Posted Tuesday, April 30, 2013 9:25 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 9:35 AM
Points: 313, Visits: 167
Thanks!, good stuff! I will practice your technic!
Cheers!
Post #1448295
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse