I'm trying to come up with something that will allow me to delete all procedures that contain aspnet in their name.
The only thing close I've found is CONTAINS but I get an error I can use it against sysobjects because it isn't indexed.
Any ideas of how I can go about doing this other than deleting each one by hand?
ThanksExecute this in query analyzer or management studio, copy the output, paste
to the top pane, and run again:
SELECT 'DROP PROCEDURE dbo.'+ROUTINE_NAME+';'
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE='PROCEDURE'
AND ROUTINE_SCHEMA='dbo'
AND ROUTINE_NAME LIKE 'aspnet[_]%'
news:d05d74cc-5383-4e2c-93ab-3182561f2726@.discussions.microsoft.com... > For reasons I won't go into I have a need to delete over a 100 stored > procedures from a database. The stored procedures have a common prefix > such as dbo.aspnet_createUser. > > I'm trying to come up with something that will allow me to delete all > procedures that contain aspnet in their name. > > The only thing close I've found is CONTAINS but I get an error I can use > it against sysobjects because it isn't indexed. > > Any ideas of how I can go about doing this other than deleting each one > by hand? > > Thanks >||| Thank you! Worked like a champ. Could you by chance recommend a good book with examples for somebody interested in learning Transact-SQL to come up with statements such as you provided? Thanks again!
No comments:
Post a Comment