存储过程:哪个更类似于 SQL Server 2000 - Postgresql 或 MySQL
我有一个 SQL Server 2000 数据库,其中有很多存储过程。我想迁移到开源数据库,并且我知道我将不得不重新编写程序,但我想以尽可能少的努力来做到这一点
I have a SQL Server 2000 database with a lot of stored procedures. I want to migrate to a open source database and well I know I will have to re write the procedures but I would like to do this with as little effort as possible
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
两者都不是直接移植,但两者相比——MySQL 的语法与 SQL Server 的语法比 PostgreSQL 更相似。
SQL Server 2000 没有分析/排名/窗口功能——MySQL 目前也没有。另外,没有WITH/CTE 支持——同样,MySQL 也不支持这一点。如果您要从 SQL Server 2005+ 迁移,出于我刚才提到的两件事之一,我会推荐 PostgreSQL 8.4+。
Neither are a direct port, but of the two -- MySQL's syntax is more similar to SQL Server's than PostgreSQL.
SQL Server 2000 didn't have analytic/ranking/windowing functionality -- neither does MySQL currently. Also, no WITH/CTE support - again, MySQL doesn't support this either. If you were migrating away from SQL Server 2005+, I'd have recommended PostgreSQL 8.4+ for the sake of either of the two things I just mentioned.
MySQL 的存储过程非常基本,例如您不能从过程中引发异常,这使得错误处理非常痛苦。此外,调试存储过程很痛苦,错误消息不清楚,而且语言本身也非常有限。
Postgres 在这方面更加成熟;如果你的应用程序有很多存储过程,这几乎排除了 mysql。
MySQL's stored procs are really basic, for instance you cannot raise an exception from within a proc, which makes error handling REALLY PAINFUL. Also, debugging stored procs is a pain, the error messages are unclear, and the language itself is pretty limited.
Postgres is much more mature for this ; if your app has lots of stored procs, this pretty much rules out mysql.
来自链接文本
from link text