日期:2014-05-16 浏览次数:20646 次
use testdb declare @tablename varchar(max) declare havetable cursor for select [name] from sysobjects where xtype='U' open havetable fetch next from havetable into @tablename WHILE @@FETCH_STATUS = 0 begin exec('delete from '+ @tablename) fetch next from havetable into @tablename end close havetable deallocate havetable DUMP TRANSACTION testdb WITH NO_LOG