当前事务无法提交,并且不支持写入日志文件的操作。回滚事务。
请帮我纠正下面的问题。
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 发布于 2017-03-21 15:31:04
请下次完成查询
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 catchhttps://stackoverflow.com/questions/42920633
复制相似问题