Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2012 keyword override

A question for which I already know there is no pretty answer.

I have a third party application that I cannot change. The application's database has been converted from MS Access to SQL Server 2012. The program connects with ODBC and does not care about the backend. It sends pretty straight-forward SQL that seems to work on SQL Server nicely as well.

There is however a problem with one table that has the name "PLAN" which I already know is a SQL Server keyword.

I know that you would normally access such a table with square brackets, but since I'm not able to change the SQL I was wondering if there is any "ugly" hack that can either override a keyword or transform SQL on the fly.

like image 235
Jakob Simon-Gaarde Avatar asked Sep 28 '13 23:09

Jakob Simon-Gaarde


1 Answers

You could try to edit the third party application with a hex editor. If you find the strings PLAN, edit this to something like PPAN and then rename the table, views etc. If you catch all, it could work. But, of course it is an ugly thing.

like image 88
Reto Avatar answered Oct 21 '22 05:10

Reto