OA删除所有表单流程数据

--将删除所有的流程表单以及底表的数据。

                                                  数据无价,请谨慎使用。

declare @sql nvarchar(1000)
declare c1 cursor for
select 'truncate table '+name from sysobjects 
where xtype='U' and name like 'formmain_%'
open c1 
fetch next from c1 into @sql
while @@fetch_status=0
begin
  exec(@sql)
  fetch next from c1 into @sql
end
close c1
deallocate c1

你可能感兴趣的:(数据库)