8

I was typing along and fat finger something and when I typed

=*

in the sql window (2008 SSMS connected to a 2005 server) it turned blue as a keyword.

I can not figure out, or google, what this does. I know *= but not =*

What does this operator do?

Mike
  • 5,918
  • 9
  • 57
  • 94

1 Answers1

21

=* is an old way to write right outer joins. For example:

select  *
from    A
right outer join
        B
on      A.bid = B.id

Is written in the old style like:

select  *
from    A
,       B
where   A.bid =* B.id
Andomar
  • 232,371
  • 49
  • 380
  • 404
  • Wow. Would =* be a left join or right join? Also it's funny when I try to write the statement I get ---- The query uses non-ANSI outer join operators ("\*=" or "=\*"). To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes. – Mike Nov 14 '12 at 15:44
  • `*=` is left outer join, and `=*` is right outer join. You can find the old syntax in the Sybase documentation here http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@ebt-link;pt=11971?target=%25N%15_13070_START_RESTART_N%25. SQL Server and Sybase started as the same product – Andomar Nov 14 '12 at 15:49