I’m trying to turn a table on its side. I’m taking our massive database and counting the number of entries in each column to help find columns that could maybe be deleted or columns that should be shifted off into their own tables. My query is giving me this data:
Col1 Col2 Col3 Col4 etc
1 439 2 54
I want to turn this on it’s side, so I have a table like so:
Name Count
Col1 1
Col3 2
Col4 54
Col2 439
so I can easily sort the data in a meaningful way (there are a lot of columns, too many to make manual review plausible)
Anyone know some SQL that could
I think that you are trying to transpose the data (aka make the vertical horizontal and vice versa).
Here is the source from microsoft on how to do that : http://support.microsoft.com/kb/202176