CodeSmith Community
Your Code. Your Way. Faster!

Drop all nettiers procedures

rated by 0 users
This post has 2 Replies | 0 Followers

Top 75 Contributor
Posts 57
Points 1,115
smallinov Posted: Wed, Apr 18 2007 10:48 AM

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

 

  • | Post Points: 35
Top 10 Contributor
Posts 925
Points 35,460
swin replied on Sun, Apr 22 2007 4:08 PM

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 -------------------------------------------------
  • | Post Points: 35
Top 75 Contributor
Posts 57
Points 1,115
smallinov replied on Mon, Apr 23 2007 12:27 PM

Awesome! Glad to see it is now a feature :-)

 -Ryan

  • | Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright © 2010 CodeSmith Tools, LLC