Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

t-sql refactoring

Posted on 2014-01-08
2
Medium Priority
?
364 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 2000 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 70

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

722 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