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 |
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-08-13 : 18:28:07
|
I need to take the example data below and put it in a treeview control, but since there's no parent/child relationship and it's all in one column. I don't know how to approach this.Our table as it sits right now, has the column (which is a primary key / nvarchar(100)) in question looking like:D1D1.01D1.01.01D1.01.01.02D1.01.01.02.003D1.01.02D1.01.02.02D1.01.02.03E1E1.01E1.01.01E1.01.01.02.003E1.01.02E1.01.02.02E1.01.02.033E1.01.02.04So, I'm thinking I have to look for the first "dot" and pull out the characters before that for the first nodes:D1E1....then look for the 2nd "dot" and pull every thing before that for the second drill down node if the user were to click on either "D1" or the "E1" nodes..and they'd see:D1D1.01E1E1.01 I think there's a strip or some function to do that, but I'm a bit stumped right now. I've seen some stuff on hierarchical data, but I'm not gettin' it.Any suggestions are welcome!Thanks! |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-14 : 01:27:02
|
Read about CHARINDEX, substring and parsename functions in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|