create   proc  
  ...  
  as  
  begin  
      set   xact_abort   on     --设置出错时自动回滚事务 
      begin   transaction    
       
      insert   tabel1   vaule(...)  
      if   @@error<>0   then  
      begin  
          rollback   transaction  
          return  
      end  
      insert   tabel2   vaule(...)  
      if   @@error<>0   then  
      begin  
          rollback   transaction  
          return  
      end  
       
      commit   transaction  
      return 

相关文章:

  • 2021-09-10
  • 2022-12-23
  • 2022-01-27
  • 2021-10-09
  • 2021-11-06
  • 2021-11-12
猜你喜欢
  • 2021-06-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
相关资源
相似解决方案