[步骤]
[11:45:36] -------------------------------------------------------------
CODE:N11453610
Error:21_596_1_-2146232060
SQL:UPDATE alias
SET alias.TotalPrice = T.ProductTotalPrice, alias.ProductTotalPrice = T.ProductTotalPrice,alias.UpdateTime = GETDATE()
FROM RB_OrderInfo alias
INNER JOIN
(
SELECT o.OrderCode,SUM(O.ProductTotalCount * C.SupplyPrice) ProductTotalPrice FROM
(
SELECT H.OrderSourceID,H.OrderCode, (L.ProductNum + L.ProductNumUpdate) ProductTotalCount,
CASE
WHEN CHARINDEX('"sku_id":"', L.ExtendedInfo) > 0 THEN
SUBSTRING(
L.ExtendedInfo,
CHARINDEX('"sku_id":"', L.ExtendedInfo) + LEN('"sku_id":"'),
CHARINDEX('"', L.ExtendedInfo, CHARINDEX('"sku_id":"', L.ExtendedInfo) + LEN('"sku_id":"'))
- (CHARINDEX('"sku_id":"', L.ExtendedInfo) + LEN('"sku_id":"'))
)
ELSE
NULL
END AS SkuId FROM dbo.RB_OrderInfo H WITH(NOLOCK)
INNER JOIN dbo.RB_OrderSource OS WITH(NOLOCK) ON H.OrderSourceID = OS.ID
INNER JOIN dbo.RB_OrderList L WITH(NOLOCK) ON H.OrderCode = L.OrderCode
INNER JOIN @tb_OrderIds oi ON H.OrderCode = oi.Id
WHERE H.CustomerID = @CustomerID AND H.AliExpressTrusteeType = @AliExpressTrusteeType
--GROUP BY H.OrderCode
) O
INNER JOIN RB_AliExpress_SkuEstimatedPrice C WITH(NOLOCK) ON O.OrderSourceID = C.OrderSourceID AND O.SkuId = c.SkuId
GROUP BY o.OrderCode
) T ON alias.OrderCode = T.OrderCode
PARAMS:@CustomerID = 1 ,@AliExpressTrusteeType = 1 ,@tb_OrderIds = 202405020108172070844, ,
MESSAGE:Cannot continue the execution because the session is in the kill state.
当前命令发生了严重错误。应放弃任何可能产生的结果。
TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)
在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms)
在 RB.DALExtendV3.RB_OrderInfoExtendV3.SetOrderInfoEstimateTotalPrice(List`1 orderIDs, Int32 customerId, Int32 aliExpressTrusteeType)
在 Biz.Irobotbox.OrderProfits.AliExpressAccountFeeBuilder.<>c__DisplayClass11_0.<UpdateBuildFeeSucessed>b__6(IEnumerable`1 page)
在 System.Linq.IEnumableExtensions.PagingProcess[TSource](IEnumerable`1 source, Action`1 pageAction, Int32 pageSize)
在 Biz.Irobotbox.OrderProfits.AliExpressAccountFeeBuilder.UpdateBuildFeeSucessed(IEnumerable`1 successList)
在 Biz.Irobotbox.OrderProfits.OrderProfitsService.ExecuteCalcOrderProfitV2(List`1 orderInfoIds, List`1 operateTypes)
在 Biz.Irobotbox.OrderProfits.OrderProfitsService.ExecuteCalcOrders(List`1 orderInfoIdList, List`1 customerIds, List`1 orderCodes, List`1 operateTypes)
在 Biz.Irobotbox.OrderProfits.OrderProfitsService.CalcOrders(List`1 customerIds, List`1 orderCodes, List`1 operateTypes)
在 Biz.Irobotbox.Order.OrderReturnService.CancelOrder(Int32 packageId, Int32 customerId, String ordercode, String username, Int32 userid)
在 Biz.Irobotbox.Order.OrderReturnService.ReturnOrder(List`1 orderParams, Int32 userid, String username, Int32 customerId)
在 PandaBuy.ERP.Web.IrobotBox.Order.Return.AddReturn.<>c__DisplayClass18_0.<Save>b__22()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
-------------------------------------------------------------
[结果]
[期望]
改善 查询 相关SQL ,并优化提升效率,加快速度 减少损耗