Transpose Row to column

Transpose Row to column

  
Hi,

Is there a way to get two column table having Table's column names in one column and record values in another column?

for example - a record

Id      Name     Employer
10     Silvia      Ebay


to a structure
Key                 Value
Id                     10
Name               Silvia
Employer         Ebay

thanks,
Pradeep V.B.
Hi Pradeep,

I do have something for this.Let me just clean it up and put it in the forge for everyone.Stay tuned!

Cheers,
André
Hi Pradeep,

I've not tried it so I have no idea if it'll work (and may be specific to the .NET stack) but have you tried PIVOT?

http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

Alternatively I'm sure André has something up his sleeves!

Cheers,
Richard
Richard Pearson wrote:
Hi Pradeep,

I've not tried it so I have no idea if it'll work (and may be specific to the .NET stack) but have you tried PIVOT?

http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

Alternatively I'm sure André has something up his sleeves!

Cheers,
Richard
 Here you go. I'll add it to the forge soon.

Edit: Add to forge. Find it here.