Manipulate SQL statement before execution on server Our databases are on SQL Server 2000. We are migrating to SQL Server 2008 R2. 
We want to update the compatibility level to 100.

But the join operator \*= and =\* are no more supported with that compatibility level. 
The advised solution is to update our source code and change the operators to OUTER JOINS. But we cannot afford the modification of thousand .exe and .dll. So we cannot update our source code; there are too many projects.

What I want to accomplish, in SQL Server 2008 R2, is the following:


Catch the SQL statement before its execution ?
Update the statement (i.e., replace *= by LEFT OUTER JOIN) ?
Give back the modified statement to the SQL engine for execution ?


This artifice is really not advised, but it will allow us to set the compatibility level to 100 event to our program still use the old syntax.

Thanks

I posted the same question on stackoverflow before I found this specific site.
https://stackoverflow.com/questions/27320554/manipulate-sql-statement-before-execution-on-server
So you need to make a choice:


Change to Compatibility Level = 100 and break your code.
Set Compatibility Level = 80 and your code will live a little longer.
Find some way to globally edit your code, dynamically or statically, so that you can switch to Compatibility Level = 100.


It would be interesting to understand why you want Level = 100 when you do not want the code to change.  

If you install SQL Server 2008 R2 the SQL Server features available for the system (such as compressed backups) will work without regard to any database's compatibility level.  So, keep your database (a little while longer) in compatibility level 80.  

EDIT: Responding to your comment on Mirroring.  Mirroring is a server feature first introduced (for production use) with SQL Server 2005 SP1.  Since this is a feature of the server, it will work for all compatibility levels running on your SQL Server 2008 R2 server.

Therefore, keep your compatibility level at 80 (SQL Server 2000) level and use mirroring on the databases where you need it.

There is a lot of documentation on mirroring, but since this is new to you, you should start by reading Ron Talmage's white paper at: http://technet.microsoft.com/en-us/library/cc917680.aspx

Please note, however, that SQL Server 2008 R2 is the last version to support SQL Server 2000 (80) compatibility. And SQL Server 2008 R2 is no longer under mainstream support since 7/8/2014, though the limited extended support will continue into 2019.  

This means that for your SQL Server next upgrade you must upgrade your T-SQL code.

END OF EDIT

Since you mention DDLs and EXEs, you seem to be indicating that your SQL queries are in the client not existing as stored procedures, functions, etc in the SQL Server. If you decide to write a wrapper code for use in your EXEs and DLLs and include it in all the locations.  That sounds as disruptive as just changing the SQL Queries.

Since you are using the *= syntax your code should look like this:

SELECT a.IdColumn, b.Description
   FROM EntityMaster a, EntityDescription b 
   WHERE a.IdColumn *= b.IdColumn


So, there is more than a single edit needed to change the code to:

SELECT a.IdColumn, b.Description
   FROM EntityMaster a LEFT OUTER JOIN EntityDescription b 
        ON a.IdColumn = b.IdColumn


And I expect you have much more complex code than that.