不妨试试,效果极好!!select "truncate table " + object_name(a.id)+ " "+ char(13)+ char(10)+ "go " + char(13)+char(10) from sysobjects a, sysindexes b
where a.type='U' and a.id=b.id and b.rows>0
group by a.id
where a.type='U' and a.id=b.id and b.rows>0
group by a.id
use tempdb --这句一定要,否则你惨了!
exec sp_MSForEachTable 'drop table ?'