第一行和最后一行的testdb改成你的数据库名
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
黑色头发:http://heisetoufa.iteye.com/