Sunday, February 19, 2012

*= Left Outer Join

I have three related tables A,B and C. In sql server 2000 I can run next que
ry:
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 ta
bles, 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 th
e behaviour of *= changed i
n the 2000 version?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?
>|||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 possibl
e, I would like to know why it doesn't works in sql server 2000 (in order to
complain) and if there wou
ld 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:
> A left outer join B on A.fk=B.id
> left outer join C on B.fk=C.id
> A,B,C
> where
> A.fk*=B.id and
> B.fk*=C.id
tables, although I have seen some examples of more than two tables in the
web (but unfortunately author didna?Tt inform about sql version). Has
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=...ublic.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...
next
> query:
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?|||Thanks for the clue Tibor, i'll try to follow it.
-- Tibor Karaszi wrote: --
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=...ublic.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.
in a
> future version?
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
message
> news:5F0EAF81-A9CD-4E0C-A57D-DC5CC8CDB47F@.microsoft.com...
next
> query:
to two
> tables, although I have seen some examples of more than two tables in
the
> web (but unfortunately author didna?Tt inform about sql version). Ha
s
> changed the behaviour of *= changed in the 2000 version?

No comments:

Post a Comment