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.
| Author |
Topic |
|
chloee
Starting Member
13 Posts |
Posted - 2004-07-06 : 08:51:50
|
| Hi guys,I have a table with the following structuremy_id int column_name varchar(200)column_value varchar(200) column_order intI need to generate a query that will show results in the following formmy_id, column_name_1, column_name_2... 1 value1 value2 2 value1 value2The final result should be in txt format.Problems are 1 - it needs to be dynamic, I don't know column number/name in advance.2 - I need to order them by column_orderI tried CASE to convert rows to column. I can order the columns to my needs but with too many columns it gives an error.I tried different dynamic crosstab stored procedures with I have found on the internet, same problem.The only working solution I have is an access with TRANSFORM and PIVOT and it works like charm, but I can't figure out how to order the columns.I'm lost! :) Any ideas are highly appreciated. |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
|
|
chloee
Starting Member
13 Posts |
Posted - 2004-07-07 : 07:32:36
|
| I tried this crosstab stored procedure and it works!Thanks!!! |
 |
|
|
|
|
|