Tuesday, 21 November 2017
     
AUSQLUG Forums Home   Search   Login   Register   Member List  
SQL Server 2000 Forums  > SQL Server - General  > HELP - Build new stucture from recordset  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: HELP - Build new stucture from recordset
RyanCaleb is not online. Last active: 8/11/2017 11:20:51 PM RyanCaleb
Top 25 Poster
Joined: 13 Sep 2017
Total Posts: 66
 
HELP - Build new stucture from recordset
Posted: 08 Nov 2017 11:20 PM
Hi guys,

I have the following task and I am looking for the best solution from performance perspective. I use MS SQL 2008R2.
The task:
there is a recordset with the following columns:
ID, level, ParentID, LabelText

For instance (recordset of table1):
1, 'D', null, 'Main 1'
2, 'D', null, 'Main 2'
3. 'C', 1, 'Sub 1'
4, 'C', 2, 'Sub 2'
5, 'B', 4, 'SubSub 1'

I would like to create the following table/recordset (table2):
LabelText (D), LabelText (C), LabelText(B)
Main 1
Main 2
Main 1 Sub 1
Main 2 Sub 2
Main 2 Sub 2 SubSub 1

Any idea is appreciated.
Thanks in advance!

I didn't find the right solution from the internet.
References:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=201016

product ads
Previous Thread :: Next Thread 
Page 1 of 1
 
AUSQLUG Forums  > SQL Server 2000 Forums  > SQL Server - General  > HELP - Build new stucture from recordset