清除数据库中所有表的数据,不删除表
declare c cursor for select NAME from sysobjects where xtype='U' declare @t varchar(200) open c fetch next from c into @t while @@FETCH_STATUS=0 begin exec('truncate table '+@t) fetch next from c into @t end close c
declare c cursor for select NAME from sysobjects where xtype='U' declare @t varchar(200) open c fetch next from c into @t while @@FETCH_STATUS=0 begin exec('truncate table '+@t) fetch next from c into @t end close c