?
Solved

Script to convert rows into column or vice-versa

Posted on 2004-09-08
2
Medium Priority
?
8,705 Views
Last Modified: 2010-05-18
I need command or script to convert rows into columns or vice-versa in MS SQL 2000. Any one has ideas or commands?
0
Comment
Question by:rsrsm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Expert Comment

by:Hilaire
ID: 12004160
Should it be a new table or just a query to make a pivot table ?
Please post sample data, current shape + expected results.

With the information you have given so far, the best I can come with is
- issue a select * in QA
- copy output to an excel file
- use Excel rotate functionality
- change column names at will
- import xl file into a new table using DTS
0
 
LVL 5

Accepted Solution

by:
g0rath earned 750 total points
ID: 12005529
Here is a pivot table stored procedure that I've used and works fairly well.
http://www.sqlteam.com/item.asp?ItemID=2955

Lately I've hand coded these by hand to insure I know what they are doing.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question