Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kirbyf
Starting Member
3 Posts |
Posted - 2008-10-09 : 19:51:57
|
| We are trying to get a legacy application working on our new SQL server 2005, and we've run into a situation where the legacy app (which we do not have the source code for) is sending raw SQL statments to the server (not via stored procedures).An example of the offeding query:SELECT foo FROM bar (INDEX=FBIndex) WHERE ...The error from the TSQL compiler isMsg 1018, Level 15, State 1, Line 1Incorrect syntax near 'INDEX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required.I thought this was what the compatibility mode was for: so you could tell the TSQL parser to process the statments as if they were running in an older version of the database engine. (if not, then what is the point of the compatibility level?)Is there any way to get these index hints to run on my new server without generating errors? Or am I screwed? If I can't get it to work, then I'll need to reformat the system and downgrade to SQL server 7.0 (*groan*) So I'm kinda desperate to find a way to make this work.The legacy app connects via ODBC, is it possible to intercept ODBC calls and rewrite them before they get submitted to the server?? like a proximitron for ODBC calls :-) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-10 : 00:39:44
|
| i think in sql server 2005 you need WITH caluse to be used before INDEX. so you could try insreting the word WITH before INDEX into queries send by app before executing in sql server |
 |
|
|
kirbyf
Starting Member
3 Posts |
Posted - 2008-10-10 : 15:56:29
|
| I'm sorry, maybe I didn't make it clear that I have no control over the application sending the queries. It is a third-party legacy application that a large part of our business is completely dependant upon. I can (and have) re-written some of the stored procedures it uses. But when it sends a raw SQL statment, I can't do anything about it.I think I've only got two options:1. Force SQL server 2005 to parse TSQL in 7.0 mode (isn't this what compatibility mode is for?)2. Catch the statments at the ODBC layer a rewrite them. This would require and ODBC proxy. Anybody have any recommendations? |
 |
|
|
PeachyICT
Starting Member
1 Post |
Posted - 2009-05-05 : 02:58:32
|
| I hsve almost exactly the same problem with one of my customers.Did you ever find a source for what is effectively a translating ODBC proxy?Graham. |
 |
|
|
|
|
|