---删除所有视图 DECLARE @vname varchar(8000) set @vname=‘‘ select @vname=@vname+Name+‘,‘ from sysobjects where xtype=‘V‘ select @vname=‘drop View ‘+ left(@vname,len(@vname)-1) exec(@vname) ---删除所有存储过程 declare @vname varchar(8000) set @vname=‘‘ select @vname=@vname+Name+‘,‘ from sysobjects where xtype=‘P‘ select @vname=‘drop PROC ‘+ left(@vname,len(@vname)-1) exec(@vname)
原文:http://www.cnblogs.com/linxianfeng/p/7612900.html