Drop all nettiers procedures - Tips/Tricks - .netTiers - CodeSmith Community
Welcome to the CodeSmith Community!

Drop all nettiers procedures

.netTiers

A description has not yet been added to this group.

Drop all nettiers procedures

  • rated by 0 users
  • This post has 2 Replies |
  • 0 Followers
  • Someone may have aleady posted something like this but I couldn't find it.

    Bascially I wanted to drop all of my nettiers procedures and regenerate as sort of a house cleaning. I had some tables that I am no longer generating for and the procedures stayed out there. This only works if you are using a prefix or suffix as you will notice. The other time this comes in handy is during the intial stages of db development / generation where you may chang your mind often about how you want things set up.

    Enjoy.

    -Ryan

     

    USE YourDBName
    GO

     

    DECLARE @procedureName SYSNAME
    DECLARE
    c CURSOR FOR

    SELECT name FROM sysobjects WHERE type = 'P' AND objectproperty(id, 'IsMSShipped') = 0 AND name LIKE 'yourProcedurePrefixHere%'

    OPEN c

    FETCH NEXT FROM c INTO @procedureName

    WHILE @@FETCH_STATUS = 0

    BEGIN

    EXEC('DROP PROC ' + @procedureName)

    FETCH NEXT FROM c INTO @procedureName

    END

    CLOSE c

    DEALLOCATE c

    GO

     

  • Nice! So nice I wrapped it up as a patch to the templates ... http://community.codesmithtools.com/forums/23942/ShowThread.aspx#23942

    Thanks

    swin

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
  • Awesome! Glad to see it is now a feature :-)

     -Ryan

Page 1 of 1 (3 items)