You are here: Re: create table with recursive relationship « MsSQL Server « IT news, forums, messages
Re: create table with recursive relationship

Posted by Hugo Kornelis on 05/16/06 23:52

On 16 May 2006 05:34:45 -0700, Robert Ludig wrote:

>I am fairly new to SQL and I am currently trying to create
>a SQL table (using Microsoft SQL) that has a recursive
>relationship, let me try to explain:
>
>I have a piece of Data let's call it "Item" wich may again contain one
>more "Items". Now how would I design a set of SQL Tables that are
>capable of storing this information?
>
>
>I tried the following two approaches:
(snip)

Hi Robert,

I agree with Tom that the first approach is better than the first. But
there are also some radically different ways to store a recursive
relationship or hierarchy. One of the more popular variants is the
nested set model. It's not nearly as intuitive as the model you are
proposing, but it performs far superior in some scenario's.

Google for "Nested Set Model" if you want to know the details.

--
Hugo Kornelis, SQL Server MVP

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация