Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Diff between Old style joins and new one?

Author  Topic 

learntsql

524 Posts

Posted - 2012-01-04 : 06:16:57
Hi All,

Please tell me the diff between Old style joins i,e. specifying all table names in WHERE clause and new joining technique.
Which one is preferable?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-01-04 : 07:21:21
Join using the WHERE clause is ANSI-89 syntax and the join using the JOIN keyword is ANSI-92 syntax. T-SQL can handle both for inner joins and I don't think there is any difference in performance.

Which one is preferable? For me, using the JOIN keyword is preferable, both because it is the more recent standard and because that allows me to use similar syntax for INNER JOINs as well as other types of JOINs.
Go to Top of Page

learntsql

524 Posts

Posted - 2012-01-04 : 07:29:17
Thank you very much.
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2012-01-04 : 08:46:45
JOIN / LEFT OUTER JOIN / RIGHT OUTER JOIN / etc

I find are much more readable than = *= =* were.

And starting to use them means a more seamless transition when you start doing things like OUTER APPLY / CROSS APPLY

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-04 : 12:30:48
Also *=,=* syntaxes are not supported from compatibility level 90 onwards in SQL server

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-04 : 13:06:06
and is not cross platform compatible...

is school back in session already?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -