Solved

t-sql refactoring

Posted on 2014-01-08
2
363 Views
Last Modified: 2014-01-09
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.
0
Comment
Question by:maqskywalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39766474
I am not aware of a tool, you will need to manually rewrite the query.
but I would like to see if such a tool would exist...

... if it where simple, ms would already have it build into it's GUI tools, and hint to that tool when this error is raised ...
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 39766540
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.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question