Solved

t-sql refactoring

Posted on 2014-01-08
2
354 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
2 Comments
 
LVL 142

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now