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
 SQL Server Development (2000)
 dynamic cursor in stored procedure

Author  Topic 

rachel_dba
Starting Member

1 Post

Posted - 2008-02-22 : 15:20:05
i have a table which is like the following

sku itemcode
101 01
102 01
103 02
102 02
101 04
101 03
and so on
the values in both the sku and itemcode in the above table can vary at times
i have to create another table dynamically where
i have to convert the itemcodes into columns therefore the table would look like this


sku itemcode01 itemcode02 itemcode03 itemcode04 ........
101 1 0 1 1
102 1 1 0 0
103 0 1 0 0
.
.
.
.
.
.
.
.
so on


please help

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-23 : 01:12:11
Read about Cross-tab reports in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-23 : 03:45:37
refer this:-

http://www.mssqltips.com/tip.asp?tip=937
Go to Top of Page
   

- Advertisement -