mysql存储过程,查询以检查是否存在 [英] mysql Stored Procedure, Query to check if exists or not

查看:607
本文介绍了mysql存储过程,查询以检查是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个可能的MySqL查询,该查询将检查数据库服务器上是否存在存储过程,如果返回的效果很好,如果没有,那么我可以使用c#插入它.

i am looking for a possible MySqL query which will check to see if a stored procedure exists on the database server, if it does great Return, if it doesnt then i can insert it using c#.

感谢您的帮助

Vade

推荐答案

您可以执行以下操作:

SELECT * FROM `information_schema`.`ROUTINES` where specific_name = 'my_procedure_name' and routine_schema = 'my_schema'

..如果存在,应该得到结果.但是,请记住,在大多数共享宿主mysql服务上,通常不允许创建例程,触发器等.如果是您自己的服务器,没问题;)

..and if it exists, should get a result. However, keep in mind that on the majority of shared hosting mysql services, routines, triggers and so on are not normally allowed to be created. If it's your own server, no problem ;)

这篇关于mysql存储过程,查询以检查是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆