Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL Server 2008 : INNER JOIN explicitely required ?

118 views
Skip to first unread message

RaghavanNJ

unread,
Jun 3, 2010, 9:51:59 AM6/3/10
to
We have thousands of SQL statements in our app, which we are migrating to
2008 from SQL 2000. I read that we have to change the Outer Join statements
using the ANSI style syntax (like LEFT or RIGHT OUTER). Fine.

But do we need to change the SQL statements which doesn't use explicitly
'INNER JOIN', by adding 'INNER JOIN' ?. I know both will work just fine.
But what to double check, and findout any issues if I am not using 'INNER
JOIN' ?

Example : The below 2 SQLs produce the same result.

SELECT a.field1, b.field2 FROM tbl1 a, tbl2 b WHERE a.id = b.id
SELECT a.field1, b.field2 FROM tbl1 a INNER JOIN tbl2 b ON a.id = b.id

Really appreciate your feedback ?


Erland Sommarskog

unread,
Jun 3, 2010, 4:59:17 PM6/3/10
to
RaghavanNJ (Ragha...@discussions.microsoft.com) writes:
> But do we need to change the SQL statements which doesn't use explicitly
> 'INNER JOIN', by adding 'INNER JOIN' ?. I know both will work just fine.
> But what to double check, and findout any issues if I am not using 'INNER
> JOIN' ?

No, that syntax has not been deprecated, and it is in fact part of the
ANSI standard. What has been deprecated is the proprietary *= and =*
syntax for outer joins.


--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0 new messages