SQL Server 2000でSQLクエリが作成されています。このクエリはSQL Server 2016で実行されていません。"*"がSQL Serverで機能していません2016
Select *
from ProjPace2 P, ProjPace2 P2
where P.DivCode *= P2.DivCode
and P.ProjGrp *= P2.ProjGrp
and P.ProjYr *= P2.ProjYr
and P.T_D *= P2.T_D
and P.Qtr *= P2.Qtr
and P.SRA_LRA *= P2.SRA_LRA
and P.District *= P2.District
and P.PICompany *= P2.PICompany
and P.ContCode *= P2.ContCode
and P.dtWkEnding > dateadd(dd,-1,'1/1/2015')
and P2.dtWkEnding between dateadd(dd,-10,'1/1/2015') and dateadd(dd,-3,'1/1/2015')
私は、次のエラーを取得しています:
Msg 4147, Level 15, State 1, Line 20
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, using the SET COMPATIBILITY_LEVEL option of ALTER DATABASE. 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.
私はので、私は同じ結果を得ることができ、エラーが原因「*」に発生していると私は左外部結合とそれを交換したい理解することができます。
ありがとうございました。
Partha
このProjPace2 Pは、 'ProjPace2 P、ProjPace2 P2'の代わりに' p1.somecol = p2.somecol'に書くとどうなりますか – TheGameiswar
このコード 'Pの意味は? DivCode * = P2.DivCode' – TheGameiswar
1.「ProjPace2 PからProjPace2 P2」を「ProjPace2 Pから左外部Join ProjPace2 P2」に変更します(正しくないかもしれません)。 2. 'where'を' on'に変更します。3. '*'記号を削除します。 4.最後の 'と'を 'where'に変更します。 –