清除数据库里面所有用户表的数据
declare @name varchar(8000)
declare cursor_a cursor for select name from sysobjects where xtype='U'
open cursor_a
fetch next from cursor_a into @name
while @@fetch_status=0
begin
exec('delete from '+@name)
fetch next from cursor_a into @name
end
close cursor_a
deallocate cursor_a
本文来自博客园,作者:忙碌在路上,转载请注明原文链接:https://www.cnblogs.com/netsa/archive/2012/09/29/2708645.html