views:

145

answers:

4
+1  Q: 

Faking SQL Server

I have application that requires SQL Server 2000 as database storage. I do not really want to use SQL Server 2000, but I can user MySQL Server instead.

Application uses ODBC to connect to SQL Server Database.

I would like to know if it is possible to make fake SQL Server which will send and receive data to/from MySQL Server

application <---> odbc manager <---> fake SQL Server driver <---> mysql server

Any one if such thing is possible to make?

+5  A: 

If your application simply uses vanilla SQL via the ODBC driver, you should be able to use MySQL with few problems. If it uses specific features of SQLServer, then you need SQLServer - you cannot realistically fake it.

anon
My application uses microsoft sql server. and it uses odbc as well. also application is running procedures only
DanSpd
Then you are probably stuffed. The SQLServer stored procedure language (T-SQL) is a huge beast compared to the very simple language implemented by MySQL. The two are not compatible.
anon
The SQL dialect is different, so you'd have to check each procedure and probably have to rewrite a large part of them.
Jimmy Shelter
A: 

You can use a provider model and just switch out which provider your using at run time.

Of course, the biggest issue will be in the differing SQL code support. So you will have to take care that all of your SQL is located inside of each provider and stay away from any sort of embedding it in your application logic.. which you should be doing anyway.

Another way is to simply change the ODBC data source at deployment time, but again, you will have to make sure the SQL code actually works in both environments; which is tough.

Typically supporting multiple database back ends is a art form in itself. Simple things like SELECT TOP 100 for SQL Server 2k versus MySql's LIMIT command are enough to keep people from doing this.

There's no real way of "faking" it because the database servers are fundamentally different. You would end up writing a fair amount of code just to translate a sql call from one to the other... Which is a waste of time.

I'd suggest you just bite the bullet and learn MS SQL Server.

This site shows a very simple example of how SQL Server, Oracle, and MySql differ on just one implementation of a select statement.

Chris Lively
I know about differences in-code but my application runs procedures only "exec procedure 12,15,'blabla'" and mysql has such thing as well but a little bit different. also i think code converter can be coded so it will convert sql 2000 to mysql and vise versa.
DanSpd
This just sounds like you are going down a maintenance nightmare. Even if it only calls procs, then you still have to duplicate those procs between the two db servers. Anything can be done; the question is how much pain you want to endure just to keep working with MySql.
Chris Lively
A: 

Not sure why you "do not really want to use SQL Server 2000" but, if you decide you need to and you have a PC with Windows available, you can use the Microsoft Database Engine 2000 Release A (MSDE2000A.exe). It is the real thing and free to use on a desktop.

http://msdn.microsoft.com/en-us/library/ms811304.aspx

I do not think it is available for download from Microsoft anymore but you might be able to find it somewhere else. If you can't find it, your next best option may be to use the 2005 version (SQL Server 2005 Express Edition) and make sure you do not use any new features since 2000:

http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx

fupsduck
+1  A: 

I wouldn't.

You're going to spend so long persuading the two to play nicely to no real benefit. You'll have to do most code the SQL Server way to work in this scenario. Given these, you might as well just bite the bullet and learn to use SQL Server directly rather than trying to tie the two together somehow, I'm afraid.

eftpotrm