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
 Old Forums
 CLOSED - General SQL Server
 cross tab problem?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-02-08 : 07:54:55
shay writes "Hi i have a view structured something like this :

id catname productname

1 aa prod1
1 bb prod2
1 aa prod1
1 bb prod2
2 cc prod3
2 dd prod4
2 cc prod3
2 dd prod4

i need to insert to another table and do string manipulation on each value, i do not know the number of columns ,all values need
to go in to one target colume so the result will look like this :

id data
1 XXaa XXbb >>prod1 >>prod2
2 XXcc XXdd >>prod3 >>prod4

etc

what is the best way to approach this? i searched around and found that this structurew is a cross-tab structure. is it? and if so how can i make it happen.
currently i am using a complicated code with cursurs that does ont realy work
and i feel is not in the right direction i hope there is a knowen solution
for this problem

thanks,

shay cohen"
   

- Advertisement -