Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,,,


if i want to create a table and i fill some rows and columns on that particular table,,if i want to change rows into columns and columns into rows,how to do this please give me some examples



Thanks In Advance
Posted
Comments
DaveAuld 25-Jun-10 7:07am    
Are you wanting to do this from within SQL tools, or are you going to use an application to connect to the database and do the manipulation? if later, what language?

1 solution

Based on your title, tags it looks like you need to do this 'transpose' in SQL Server. A cross tab type of property is provided in SQL Server 2005.
Look here for sample exaple:
How do I create a cross-tab (or "pivot") query[^]
Using PIVOT and UNPIVOT[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900