Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: Recursive relationships and ASP


Message #1 by "Gavin Landon" <glandon@g...> on Mon, 12 Aug 2002 16:03:01 -0500
Yes, SQL Server does support recursive JOINS..

SELECT
    ta1.Field1 as Field1,
    ta2. Field1 as Field2,
    ta3. Field1 as Field3
FROM
    Table1 as ta1
LEFT JOIN
    Table2 as ta2 ON ta2.[ID] = ta1.ta2ID
LEFT JOIN
    Table3 as ta3 ON ta3.[ID] = ta1.ta3ID
WHERE
    ta1.LastName='Landon'



"Håkan Frennesson" <hakan@c...> wrote in message
news:170797@a..._databases...

Hi!

I have a table coming from a x.500 directory looking something like this:

3 fields
Distinguishedname Adress Telefon
-------------------------------------------------------------------------
ou=se,ou=div 1 Carson St 1 123123
ou=se,ou=div 1,ou=unit a Carson St 2 78976
ou=se,ou=div 1,ou=unit a,ou=sub unit 1 Carson St 4 123423
ou=se,ou=div 1,ou=unit a,ou=sub unit 1,ou=room 12 Carson St 5 321321
ou=se,ou=div 1,ou=unit a,ou=sub unit 2 Carson St 3 543543
ou=se,ou=div 2 Andes St 1 321321
ou=se,ou=div 2,ou=unit a Andes St 3 543543
ou=se,ou=div 2,ou=unit a,ou=sub unit 1 Andes St 2 321321
ou=se,ou=div 2,ou=unit a,ou=sub unit 2 Andes St 4 1231231
etc...

This table is imported once a day to SQL Server 2000 and will supposedly be
used in a
ASP application. As you can see there are 1-to-many relationships within the
table and the values separated by a comma may vary, from 2 up to 6 values
(sub-sub-units)

As far as I know SQL Server doesn´t support recursive joins. I am a bit
confused which road to take to be able to use this kind of data (listings
etc). Does anyone of you developers out there have some advice on how to
deal with this kind of situation? Any advice is greatly appreciated.

Thanks,

Hakan






  Return to Index