Sql Server 和 MySQL 中的存储过程和触发器相同吗?
我有两个存储过程和一个触发器,用于我正在使用的一类,它们是在 sql server 2005 中完成的。我想使用 phpmyadmin 在 mysql 中重新创建它们。每次我把它们放进去时,我都会收到 1064 错误。这是因为phpmyadmin不能很好地处理存储过程或触发器,还是因为sql server 2005到mysql的语法有很大不同?如果是这样,那么我可以去哪里在线学习在 mysql/phpmyadmin 中编写存储过程和触发器的正确语法...或者我应该在 barnes and Nobels 买一本书?这是我的高级项目。
I have two stored procedures and one trigger for a class I am taking that are done in sql server 2005. I want to recreate them in mysql with phpmyadmin. Everytime i put them in I get a 1064 error. Is this becuase phpmyadmin does not handle stored procedures or triggers well, or is it becuase the syntax from sql server 2005 to mysql is very different? If it is this, then where could i go online to learn the correct syntax to write my stored procedures and triggers in mysql/phpmyadmin... or should I just pick up a book at barnes and nobles? This is my senior project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MySQL 中的语法和功能集会略有不同,但概念、使用模式和设计动机即使不相同,也会非常相似。我建议在购买任何书籍之前先阅读 MySQL 手册:
触发器
存储过程
所以你绝对可以移植你的T-SQL 代码转换为 MySQL 的 SQL 方言。
The syntax and feature sets in MySQL will be slightly different, but the concepts and usage patterns and design motivations will be very similar if not identical. I suggest reading up in the MySQL manuals before buying any books:
Triggers
Stored Procedures
So you can definitely port your T-SQL code to MySQL's SQL dialect.
这是因为 MySQL 不支持 Transact-SQL,这是 Sybase 和 MSSQLServer 用于编写触发器和存储过程的 SQL 变体。
因此,您的问题的答案是:否。
It's because MySQL does not support Transact-SQL, which is the SQL variant Sybase and MSSQLServer use to program triggers and stored procedures.
So, the answer to your question is: NO.