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
 General SQL Server Forums
 New to SQL Server Programming
 break /split from a cell into columns

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-02-21 : 05:00:09
hi,

i have labels for data stored in one cell
eg: item1; item22; item231;
and i want to convert it in following output
(probably using substring and charindex)

No_question | item_position | label
1 | 1 | item1
1 | 2 | item22
1 | 3 | item231


any idea?

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-02-21 : 05:34:41
Can you explain your logic behind the output?
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-02-21 : 05:43:13
name of items are stored in one cell, separeted by semicolumn (;).

What I need to do is to have the first integer running (No_question = 1) and telling me, that this values are from one cell (namely one question), then i need the second integer counting items stored in one cell (item_position) and the label basically the name stored in right row with both integeres (No_question, item_position) right.

it's not that complicated as it seems :)
Go to Top of Page
   

- Advertisement -