Reputation: 1
What if the opposite of this is to be done.. that is, the column values of one table are to be inserted as the row value of another table. For example suppose that I have a table having data:
Table1
a1
b1
c3
d4
and I want to insert these columns as a row into another table, supposedly Table2 as:
Table2
a1 b1 c3 d4
How can this be done using a T-SQL Query..?!
Upvotes: 0
Views: 122
Reputation: 51494
By using PIVOT
http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx
Upvotes: 1