Alter Procedure vs. Drop/Create

  • We have historically administered stored procedures by doing Drop/Create commands instead of Alter, simply because there was no "last modified date" in prior versions.  Since SQL Server 2005 now has a modified date available, I can't think of any reason not to start using Alter.  Is there anyone that has experience that would indicate otherwise?  Thanks!   

  • If you are properly versioning scripts (each object as a script file), then those scripts should be built using IF EXISTS...DROP / CREATE.

    The object must be CREATEd before it can be ALTERed.  The original script that built the object must be a CREATE.  So leave it that way.  When the time comes to move an object from dev to test or test to production, the original script file will always work - the first time the object moves, and each update following the initial push.

    -Eddie

    Eddie Wuerch
    MCM: SQL

  • Check out this blog: http://spaces.msn.com/drsql/

    (May 2nd entry) for a discussion on just this topic.

  • Interesting.  That would allow us to avoid the issues with re-granting security, as well as the issues with Alter vs. Create in the stored scripts.  Thanks for the input, folks.

  • Pam Brisjar - Tuesday, May 9, 2006 7:38 AM

    Check out this blog: http://spaces.msn.com/drsql/

    (May 2nd entry) for a discussion on just this topic.

    No sure what's wrong with that link or, perhaps, my box, but it doesn't seem to take me to anything useful.  In fact, it takes me to and empty "One Drive" space.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Saturday, May 6, 2017 12:34 PM

    Pam Brisjar - Tuesday, May 9, 2006 7:38 AM

    Check out this blog: http://spaces.msn.com/drsql/

    (May 2nd entry) for a discussion on just this topic.

    No sure what's wrong with that link or, perhaps, my box, but it doesn't seem to take me to anything useful.  In fact, it takes me to and empty "One Drive" space.

    Jeff, the link is 11 years old and has probably died by now.  That was just after SQL 2005 was released.  Scary how old it is already.  And yes, my SQL 2005 box is still running because the one application can't be migrated to use SQL 2008. We've tried and confirmed it. :crazy:

  • Ed Wagner - Saturday, May 6, 2017 3:22 PM

    Jeff Moden - Saturday, May 6, 2017 12:34 PM

    Pam Brisjar - Tuesday, May 9, 2006 7:38 AM

    Check out this blog: http://spaces.msn.com/drsql/

    (May 2nd entry) for a discussion on just this topic.

    No sure what's wrong with that link or, perhaps, my box, but it doesn't seem to take me to anything useful.  In fact, it takes me to and empty "One Drive" space.

    Jeff, the link is 11 years old and has probably died by now.  That was just after SQL 2005 was released.  Scary how old it is already.  And yes, my SQL 2005 box is still running because the one application can't be migrated to use SQL 2008. We've tried and confirmed it. :crazy:

    Heh... holy moly.  I didn't even look at the date.  I wonder why the bloody thing show up as a recently-added-to post.  Maybe a spam post was added and deleted.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 7 posts - 1 through 6 (of 6 total)

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