mysql Stored Procedure, Query to check if exists or not

前端 未结 2 938
滥情空心
滥情空心 2021-01-15 19:29

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

2条回答
  •  野的像风
    2021-01-15 19:44

    On MS SQL you can perform the following query:

    if exists
    (
        select name from sysobjects
        where name = 'function_name' and type = 'fn'
    )
    begin
        drop function function_name
    end
    go
    

提交回复
热议问题