sql server无法提交当前事务,并且无法支持写入日志文件的操作。回滚事务

sql server无法提交当前事务,并且无法支持写入日志文件的操作。回滚事务,sql,sql-server,Sql,Sql Server,无法提交当前事务,并且无法支持写入日志文件的操作。回滚事务 请帮我更正下面的问题 BEGIN TRAN COMMIT TRAN --RETURN @pOrgID END print @Increment SET @Increment=@Increment+1 END print 'test' Update table1 Set stat

无法提交当前事务,并且无法支持写入日志文件的操作。回滚事务

请帮我更正下面的问题

BEGIN TRAN      
COMMIT TRAN        
   --RETURN @pOrgID        
  END        

  print @Increment        

  SET @Increment=@Increment+1        
  END        

  print 'test'        

  Update table1 Set status='DONE',Processeddatetime=getutcdate() where OAPermID=@POAPermID         
   and Systemstartdatetime=@pSystemstartdatetime and BatchID=@BatchID        

   Update table1 Set status='DONE' where Organizationid=@POAPermID and status='pending' and BatchID=@BatchID        

 END TRY  

请下次完成查询

  begin try
  begin transaction
  declare @Increment as int = 0
print @Increment
set @Increment=@Increment+1
print 'test'
Update table1 Set status='DONE',Processeddatetime=getutcdate() where OAPermID=@POAPermID
and Systemstartdatetime=@pSystemstartdatetime and BatchID=@BatchID
Update table1 Set status='DONE' where Organizationid=@POAPermID and status='pending' and BatchID=@BatchID
  commit transaction
    end try
  begin catch
  declare @xact_status as varchar(30) = cast(xact_state() as varchar(30))
  select error_number() as errornumber, error_line() as errorline, error_message() as errormessage,
         error_procedure() as errorprocedure, error_state() AS errorState, error_severity() as errorseverity,
         @xact_status as exactstatus
  rollback transaction       
  end catch

这里似乎缺少代码。对于初学者,没有
开始尝试
。请确保包含所有相关代码,并将块格式化为具有适当缩进的代码,以便我们更容易阅读并提供帮助。