Sunday, February 19, 2012

*= Left Outer Join

I have three related tables A,B and C. In sql server 2000 I can run next query:
select * from
A left outer join B on A.fk=B.i
left outer join C on B.fk=C.i
but below query give me an "invalid outer combination" error:
select * from
A,B,
where
A.fk*=B.id an
B.fk*=C.i
It seems outer combinations configured in where clause are limited to two tables, although I have seen some examples of more than two tables in the web (but unfortunately author didnâ't inform about sql version). Has changed the behaviour of *= changed in the 2000 versionWhy do you want to use deprecated syntax that will not be supported in a
future version?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"David Palomar" <anonymous@.discussions.microsoft.com> wrote in message
news:5F0EAF81-A9CD-4E0C-A57D-DC5CC8CDB47F@.microsoft.com...
> I have three related tables A,B and C. In sql server 2000 I can run next
query:
> select * from
> A left outer join B on A.fk=B.id
> left outer join C on B.fk=C.id
> but below query give me an "invalid outer combination" error:
> select * from
> A,B,C
> where
> A.fk*=B.id and
> B.fk*=C.id
> It seems outer combinations configured in where clause are limited to two
tables, although I have seen some examples of more than two tables in the
web (but unfortunately author didnâ?Tt inform about sql version). Has
changed the behaviour of *= changed in the 2000 version?
>|||Thatâ's very true Aaron, but I',m using an automatic persistence tool which generates this kind of joins and I can't do anything about. So, if possible, I would like to know why it doesn't works in sql server 2000 (in order to complain) and if there would be a way to circumvent the problem in the mean time.
-- Aaron Bertrand - MVP wrote: --
Why do you want to use deprecated syntax that will not be supported in
future version
--
Aaron Bertran
SQL Server MV
http://www.aspfaq.com
"David Palomar" <anonymous@.discussions.microsoft.com> wrote in messag
news:5F0EAF81-A9CD-4E0C-A57D-DC5CC8CDB47F@.microsoft.com..
> I have three related tables A,B and C. In sql server 2000 I can run nex
query
>> select * fro
> A left outer join B on A.fk=B.i
> left outer join C on B.fk=C.i
>> but below query give me an "invalid outer combination" error
>> select * fro
> A,B,
> wher
> A.fk*=B.id an
> B.fk*=C.i
>> It seems outer combinations configured in where clause are limited to tw
tables, although I have seen some examples of more than two tables in th
web (but unfortunately author didnâ?Tt inform about sql version). Ha
changed the behaviour of *= changed in the 2000 version
>|||There are restriction for old-style joins. I don't know them all by heart
(you should be able to find them in Books Online), but I believe that one is
that you can't do more than one OJ in a query. You really need to get a
version of your tool that supports the new proper way to specify an outer
join.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"David Palomar" <anonymous@.discussions.microsoft.com> wrote in message
news:3DF4DD3C-DF25-42C6-B8C4-5B504F1E5A04@.microsoft.com...
> That's very true Aaron, but I',m using an automatic persistence tool which
generates this kind of joins and I can't do anything about. So, if
possible, I would like to know why it doesn't works in sql server 2000 (in
order to complain) and if there would be a way to circumvent the problem in
the mean time.
> -- Aaron Bertrand - MVP wrote: --
> Why do you want to use deprecated syntax that will not be supported
in a
> future version?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "David Palomar" <anonymous@.discussions.microsoft.com> wrote in
message
> news:5F0EAF81-A9CD-4E0C-A57D-DC5CC8CDB47F@.microsoft.com...
> > I have three related tables A,B and C. In sql server 2000 I can run
next
> query:
> >> select * from
> > A left outer join B on A.fk=B.id
> > left outer join C on B.fk=C.id
> >> but below query give me an "invalid outer combination" error:
> >> select * from
> > A,B,C
> > where
> > A.fk*=B.id and
> > B.fk*=C.id
> >> It seems outer combinations configured in where clause are limited
to two
> tables, although I have seen some examples of more than two tables in
the
> web (but unfortunately author didnâ?Tt inform about sql version). Has
> changed the behaviour of *= changed in the 2000 version?
> >

No comments:

Post a Comment