标签:
清空数据库所有表数据
1 declare c cursor for 2 select name from sysobjects where xtype=‘u‘ order by name; 3 4 open c; 5 declare @t varchar(200); 6 declare @sql varchar(max); 7 8 fetch next from c into @t; 9 while(@@FETCH_STATUS=0) 10 begin 11 set @sql=‘truncate table ‘+@t; 12 exec(@sql); 13 14 fetch next from c into @t; 15 end; 16 17 close c; 18 deallocate c;
标签:
原文地址:http://www.cnblogs.com/eval/p/5386938.html