Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
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
来源:https://blog.51cto.com/u_176133/3335564