Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 PIVOT a Colum into Rows

Author  Topic 

baaul
Starting Member

16 Posts

Posted - 2005-10-02 : 23:00:15
Is there a way to PIVOT Strings from "Answer" column...

For Example:

BookId SheetId Answer
-------- ------- ---------------------------------------------------------------------------------------------------
E06R 001 2 2 1122 2
E06R 002 2 2 2


convert to:

BookId SheetId Answer
------ ------- -----------------------------------------------------------------------------------------------------
E06R 001 2
E06R 001
E06R 001 2
E06R 001
E06R 001 1
E06R 001 1
E06R 001 2
E06R 001 2
E06R 001
E06R 001 2
E06R 002 2
E06R 002
E06R 002 2
E06R 002
E06R 002 2

e.t.c....


If there's no easy way, what kind of procedure can I use to achieve this? Please give detailed info on this, it's a SQL Server 2000 table I'm trying to PIVOT and load into. Thanks in advance.

-baaul

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2005-10-03 : 01:47:54
check this link if its makes any sense to you.

http://www.sqlteam.com/item.asp?ItemID=2955


Complicated things can be done by simple thinking
Go to Top of Page
   

- Advertisement -