Creating a stored procedure if it does not already exist

后端 未结 9 1003
谎友^
谎友^ 2021-02-05 01:12

I want to check if a list of stored procedures exist. I want this all to be done in 1 script, one by one. So far I have this format:

USE [myDatabase]
GO

IF NO         


        
9条回答
  •  鱼传尺愫
    2021-02-05 01:45

    you can execute the following:

    DROP PROCEDURE IF EXISTS name_of_procedure;
    CREATE PROCEDURE name_of_procedure(....)
    

提交回复
热议问题