伪造 SQL Server

发布于 2024-08-17 11:51:44 字数 312 浏览 3 评论 0原文

我有需要 SQL Server 2000 作为数据库存储的应用程序。 我并不是真的想使用 SQL Server 2000,但我可以使用 MySQL Server。

应用程序使用 ODBC 连接到 SQL Server 数据库。

我想知道是否可以制作假 SQL Server,它将数据发送到 MySQL Server

应用程序或从 MySQL Server 应用程序接收数据<---> ODBC 管理器<--->伪造的 SQL Server 驱动程序 <---> mysql 服务器

任何人都可以做这样的事情吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

姐不稀罕 2024-08-24 11:51:44

如果您的应用程序只是通过 ODBC 驱动程序使用普通 SQL,那么您应该能够使用 MySQL,而不会出现什么问题。如果它使用 SQLServer 的特定功能,那么您就需要 SQLServer - 实际上您无法伪造它。

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.

绝對不後悔。 2024-08-24 11:51:44

我不会。

你要花很长时间说服两人好好相处,却没有任何实际好处。在这种情况下,您必须以 SQL Server 方式完成大部分代码工作。考虑到这些,恐怕您还不如硬着头皮学习直接使用 SQL Server,而不是试图以某种方式将两者结合在一起。

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.

梦在深巷 2024-08-24 11:51:44

您可以使用提供程序模型,只需在运行时切换您使用的提供程序即可。

当然,最大的问题是不同的 SQL 代码支持。因此,您必须注意所有 SQL 都位于每个提供程序内部,并远离任何形式的将其嵌入到您的应用程序逻辑中……无论如何,您都应该这样做。

另一种方法是在部署时简单地更改 ODBC 数据源,但同样,您必须确保 SQL 代码在两种环境中实际工作;这很难。

通常,支持多个数据库后端本身就是一种艺术形式。像 SELECT TOP 100 for SQL Server 2k 与 MySql 的 LIMIT 命令这样简单的事情就足以阻止人们这样做。

没有真正的方法可以“伪造”它,因为数据库服务器根本不同。您最终会编写大量代码只是为了将 sql 调用从一个调用转换为另一个调用...这是浪费时间。

我建议你硬着头皮学习 MS SQL Server。

此站点展示了一个非常简单的示例,说明 SQL 如何使用Server、Oracle 和 MySql 仅在 select 语句的一种实现上有所不同。

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.

拔了角的鹿 2024-08-24 11:51:44

不确定为什么您“并不真正想使用 SQL Server 2000”,但是,如果您决定需要并且您有一台装有 Windows 的 PC,则可以使用 Microsoft Database Engine 2000 Release A (MSDE2000A.exe)。它是真实的,并且可以在桌面上免费使用。

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

我认为 Microsoft 不再提供它的下载,但您也许可以在其他地方找到它。如果找不到它,下一个最佳选择可能是使用 2005 版本(SQL Server 2005 Express Edition),并确保不使用 2000 年以来的任何新功能

: microsoft.com/Sqlserver/2005/en/us/express.aspx" rel="nofollow noreferrer">http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文