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 |
|
JNOM
Starting Member
3 Posts |
Posted - 2002-05-26 : 17:57:49
|
| I noticed that a lot of people read my previous topic but no answers so this is what I have,TBL_Hierarchyid Group Category Family Line Model-------------------------------------------------------------1 Imaging DOP DOP - HDM ManRodland Komori2 Imaging DOP DOP - HDM ManRodland Maxwell3 Imaging DOP DOP - HDM Legacy Thermal I4 Imaging DOP DOP - HDM Legacy Thermal IIetc...This is what I want to accomplishID HierarchyName ParentID--------------------------------------1 Imaging 02 DOP 13 DOP - HDM 24 ManRoland 35 Komori 46 Maxwell 47 Legacy 38 Thermal I 79 Thermal II 7etc..So what I'm trying to build is a query or sp that would populate the second table, any input will be greatly welcomed!! |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-05-26 : 20:43:13
|
| create table a (id int identity ,name varchar(100) ,pid int)insert aselect distinct Group, 0 from tblinsert aselect distinct Category, (select id from a where name = Group and pid = 0)from tbl......==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|