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

相关文章:

  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-08-13
  • 2022-12-23
  • 2021-06-06
猜你喜欢
  • 2021-12-07
  • 2021-07-12
  • 2022-12-23
  • 2022-02-07
  • 2021-11-05
相关资源
相似解决方案