Avatar of maqskywalker
maqskywalker
 asked on

t-sql refactoring

Hi experts,

I have a sql server stored procedure that was created in 2000.

I'm currently using Sql Server 2008 R2.

The database this stored procedure is located in is currently set to a compatibility_level = 100

When I run the stored procedure I get the error shown below.

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.

When I change the compatibility level of my database to compatibility_level = 80 then my query runs fine.

I don't want to change the compatibility level.  I want my compatibiliy_level to remain at 100.
So according to the error message I get, I figure my only option is to rewrite the query.

It's kind of a complex query.
Is there a tool out there? Whether its a free or commercial tool,  
where I can just paste my existing query in and it will refactor my query to a more current syntax that will be able to run on my database when I set it to compatibility_level = 100

thanks.
Microsoft SQL ServerMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
Scott Pletcher

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scott Pletcher

Just the outer joins shouldn't be that hard to rewrite.

Post the FROM and the WHERE conditions of the query; don't really need the SELECT list.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck