sql 删除所有表

sql删除所有表语句:

use 数据库名(是要删除表的所在的那个数据库的名称)
GO
declare @sql varchar(8000)
while (select count(*) from sysobjects where type='U')>0
begin
SELECT @sql='drop table ' + name
FROM sysobjects
WHERE (type = 'U')
ORDER BY 'drop table ' + name
exec(@sql) 
end-----------------------------------------------use 数据库一定要填对哦......

  哦了!

posted @ 2017-01-04 09:56  雪~中~狼  阅读(308)  评论(0编辑  收藏  举报