Reputation: 32179
Is there any support for natural joins in recent Microsoft SQL Server editions? Or is there a good alternative for making SQL Server work out the predicates that would have been in the ON
clauses based on the referential integrity?
Upvotes: 42
Views: 70765
Reputation: 432311
No, and thank the lucky stars
I can't believe that you'd want the engine to guess the JOIN for you
Related links:
Edit, to explain why
Quoting Bill Karwin in this excellent answer:
I never use NATURAL JOIN because I don't like the possibility that the join could do something I don't intend just because some column name exists in both tables.
Upvotes: 45
Reputation: 161
MS SQL does not support natural join, neither join using (). You have to explicitly write down all your attributes used in the join.
If the datamodel
changes, you have to change all "natural join" written by hand and make sure your join condition is ok again.
Upvotes: 8
Reputation: 239724
I wouldn't expect to see it any time soon. A Connect suggestion from 2006 has very little info other than:
Thanks for your feedback. We will look into your request for one of the upcoming releases.
And has only received ~30 upvotes
Upvotes: 5