use 您要清空的库
go
declare @tbname varchar(250)
declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1
open #tb
fetch next from #tb into @tbname
while @@fetch_status=0
begin
exec('delete from ['+@tbname+']')
fetch next from #tb into @tbname
end
close #tb
deallocate #tb
清空任何表记录的存储过程
最新推荐文章于 2023-03-12 22:37:10 发布