//Here we can alter the code to get table name procedure name and so on in the exec command
declare @ProcName varchar(500)
declare cur cursor
for select [t.name ] from sys.objects as t where type='P'
open cur
fetch next from cur into @ProcName
while @@fetch_status = 0
begin
exec ( 'drop procedure ' + @ProcName)
fetch next from cur into @ProcName
end
close cur
deallocate cur
-------------------------------------------
declare @ProcName varchar(500)
declare cur cursor
for select t.name from sys.objects as t where type='P' and t.name like 'cpt%'
open cur
fetch next from cur into @ProcName
while @@fetch_status = 0
begin
exec ( 'sp_helptext ' + @ProcName)
fetch next from cur into @ProcName
end
close cur
deallocate cur
No comments:
Post a Comment