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+']')    --exec('truncate table ['+@tbname+']')
  fetch next from #tb into @tbname
end
close #tb
deallocate #tb

相关文章:

  • 2021-09-23
  • 2021-08-16
  • 2021-08-17
  • 2022-01-24
  • 2021-09-18
  • 2022-12-23
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2021-07-01
  • 2022-12-23
  • 2021-10-30
相关资源
相似解决方案