批量删除SQL数据库中的所有表【笔记】

use OTRJiraDB
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
原文地址:https://www.cnblogs.com/songxingzhu/p/6137486.html