开发者

T-SQL 2000 to 2008

I have around 200-250 reports that have been developed in SQL Server 2000 and I ha开发者_JAVA百科ve used *= , =* in many places. So recently we migrated to SQL Server 2008 and all reports have to be fixed for the 2008 standard.

So I have couple of issue in compatibility like

"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."

So it takes long time to re-query all things and fixing. Even we don't need to enable backward compatibility of 2008, we do need to fix all those queries...

Is there any tool that will fix all those queries easily?

Thanks and Best Regards,


The Microsoft SQL Server 2008 Upgrade Advisor should identify the offending TSQL, but it won't fix it for you.

It is a prudent idea to run the SQL Server 2008 Upgrade Advisor on all Databases to be upgraded.


There is no tool. How can any tool know what the semantics would be of this, for example?

You are changing

FROM Table1 T1, Table2 T2, Table2 T3
WHERE T1.key *= T2.key AND T1.key = T3.key AND T3.foo = 'bar'

to

FROM
   Table T1
   JOIN
   Table T3 ON T1.key = T3.key
   LEFT JOIN
   Table T2 ON T1.key = T3.key
WHERE
    T3.foo = 'bar'

You have been able to use JOIN/LEFT JOIN etc since at least SQL Server 6.5: using *= for SQL Server 2000 was ignorance and/or laziness


There is a tool built into SSMS that can help, but you will still need to test. See my post on SSC which describes the technique:

http://www.sqlservercentral.com/Forums/FindPost1098339.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜