---------------------删除所有的视图-------------------
use test_databse
GO
declare @sql varchar(8000)
while (select count(*) from sysobjects where type='V')>0
begin
SELECT @sql='drop view ' + name FROM sysobjects WHERE (type = 'V')
ORDER BY 'drop view ' + name exec(@sql)
end
-------------------删除所有的存储过程-------------------
use test_databse
GO
declare @sql varchar(8000)
while (select count(*) from sysobjects where type='P')>0
begin
SELECT @sql='drop proc ' + name FROM sysobjects WHERE (type = 'P')
ORDER BY 'drop table ' + name exec(@sql)
end