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 |
|
ernie99
Starting Member
12 Posts |
Posted - 2009-03-25 : 08:04:25
|
| Hi everyone,I have a column called 'Parents' that contains a string of Parent Categories separated by a | character e.g. |0|295|297|301|I need to dynamically generate a column that contains the description value for each category in this string separated by a / character e.g. /News/Investors/About Us/Resource Library/Therefore on the fly I have to extract each Category from the column 'Parents' and select the value of the column 'Description' for that Category.An example result set would look like the following--------------------------------------------------------------CATEGORIES--------------------------------------------------------------CAT_ID-----DESCRIPTION----------PARENTS----------PARENT_DESCRIPTION312--------Home-----------------|0|295|----------News/Investors295--------Investors------------|0|312|----------News/Home308--------About Us-------------|0|295|312|------News/Investors/HomeIf anyone can help me get started on this I would greatly appreciate it.Thanks to anyone who views this post. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
ernie99
Starting Member
12 Posts |
Posted - 2009-03-25 : 09:55:31
|
| That's for the advice, much appreciated. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-25 : 14:07:33
|
| why are you storing parent id values in delimited form? why is your table not normalised? |
 |
|
|
|
|
|