Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
If anyone can help i am the most happiest...
If anyone can help i am the most happiest person in world
Rate Topic
Display Mode
Topic Options
Author
Message
sureshk 23318
sureshk 23318
Posted Tuesday, October 16, 2012 12:32 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, November 09, 2012 3:19 AM
Points: 1,
Visits: 9
i have a table like
TID
PID
DSC
1 0 Parent1
2 1 Child1
3 1 Child2
4 1 Child3
5 0 ParentA
6 5 ChildA
7 5 ChildB
Post #1373049
Kingston Dhasian
Kingston Dhasian
Posted Tuesday, October 16, 2012 12:51 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 2,231,
Visits: 4,202
Well, nobody can help with this limited amount of information
Please describe your issue and give us some sample data and the expected results as per your sample data
It would be really good if you can provide this in a readily usable format
If you are not sure on how to do this, reading the link in my signature would give you a good idea
Kingston Dhasian
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1373053
Jeff Moden
Jeff Moden
Posted Tuesday, October 16, 2012 8:04 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 4:51 PM
Points: 32,923,
Visits: 26,811
sureshk 23318 (10/16/2012)
i have a table like
TID
PID
DSC
1 0 Parent1
2 1 Child1
3 1 Child2
4 1 Child3
5 0 ParentA
6 5 ChildA
7 5 ChildB
That's what's known as an "Adjacency List". They usually hold a hierarchical tree of data. An "Adjacency List" is very easy for even humans to maintain but are seriously performance challenged when it comes to processing. If it were me, I'd build a Nested Sets structure into this table for the best of both worlds.
It would appear that you're either missing the very top level or you don't mind working with multiple trees known as a "forest". The problem with the missing the top level is that you can't actually have any DRI between the PID and the TID column.
I also agree with the previous post... what is the actual querstion here?
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1373285
Eugene Elutin
Eugene Elutin
Posted Tuesday, October 16, 2012 8:18 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 10:39 AM
Points: 2,556,
Visits: 4,398
May be the post should read like:
Have I table like a:.... ?
Actually the question is in the post title:
If anyone can help? ...
The answer is: Yes, definitely someone can help!
_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)
How to post your question to get the best and quick help
Post #1373298
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.