views:

63

answers:

3

I have legacy application that checks to see if the version of SQL Server is 6.5, 7 or 2000. If not, it returns a database not supported error. I would like this application to use the database on SQL Server 2008. Is there a way to fake the version so that the application check for SQL Server version passes. My legacy application code is FoxPro. I do not have the means to recompile the FoxPro application.

+6  A: 

Have you tried setting the compatibility level to 80 (which means SQL Server 2000):

EXEC sp_dbcmptlevel AdventureWorks, 80;

Version of SQL Server database can be one of the following:

  • 60 = SQL Server 6.0
  • 65 = SQL Server 6.5
  • 70 = SQL Server 7.0
  • 80 = SQL Server 2000
  • 90 = SQL Server 2005
OMG Ponies
+2  A: 

Setting the compatibility level of the database should work fine. You can do this using sp_dbcmptlevel

AlexCuse
Nope. Does not seem to work. Looks like the code is looking for server setting not database compatibility level. The darn code is in FoxPro.
shikarishambu
Oh man, that is brutal. My condolences :(
AlexCuse
What's brutal ?
Alan B
I'd have to answer your question with another question - exactly what about this situation is NOT brutal? Is it the part about not having a means to compile (IF the source is even available)? Or is it the part about being locked into a 10 year old database (which could force you to set up a whole new server if another app you support only runs on 2005+)? Or were you just looking to get into an idiotic argument about languages?
AlexCuse
+3  A: 

Applications usually verify the current server version by checking either @@VERSION or SERVERPROPERTY('ProductVersion'). Both are impossible to override or fake.

Applications that do not explicitly check the version can run in a database with a lower compatibility level. But if the application has code that explicitly checks one of the above, there is nothing you can do.

Remus Rusanu