create or replace

  • Is it possible to create a 'command' that will replace

    if exists (select * from sysobjects where id = object_id('usp_myproc')) begin

    drop procedure usp_myproc

    end

    create procedure usp_myproc

    with

    create or replace usp_myproc ...

    ?

    in which case I would like to know how?

    Best regards

    Henrik Staun Poulsen

    Stovi Software

    Denmark

  • Not sure I understand our question. Are you wanting to change a procedure, if so then ALTER PROCEDURE. Other than that can you clarify?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I'm just trying to be lazy here.

    In Oracle (I think it is) you can write

    Create or Replace Procedure xxx

    and not have to write an entire novel, just to create a simple procedure.

    I want to create it if it isn't there, or overwrite it, if it's there.

  • Easiest you will be able to do is drop like you have then just create, not worrying about what it is like.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply