5 April, 2013
0 Comments
1 category
if you want to drop all stored procedures not belonging to the dbo schema from a SQL Server database, you van use the following select statement to generate a list that can be executed to drop the sprocs.
PS: It’s your foot.
select 'drop procedure ' + s.name + '.' + o.name from sys.objects o with (nolock) inner join sys.schemas s with (nolock) on o.schema_id = s.schema_id where o.type = 'P' and s.name <> 'dbo'
Tags: SQL ServerT-SQL
Category: Uncategorized