[步骤]
[18:47:16] -------------------------------------------------------------
CODE:O1847161
Error:16_8623_1_-2146232060
SQL:
select
orderfee.BusinessTeamID GROUPID
,orderfee.BusinessTeamName GroupName
,orderfee.OperateFeeRMB
,orderfee.OperateFeeUSD,orderfee.SalesPriceFeeRMB
,orderfee.SalesPriceFeeUSD
,ISNULL(ordernum.OrderNum,0) OrderNum
,orderfee.FundMoneyRMB,orderfee.FundMoneyUSD
,orderfee.SalesRefundsV2RMB,orderfee.SalesRefundsV2USD
,cast(MONTH(orderfee.DateToday) AS varchar) + '/'+ cast(DAY(orderfee.DateToday) AS varchar) AS XAxis
,orderfee.DateToday
from
(
select
CustomerID
,BusinessTeamID
,case when BusinessTeamName='' then '未分组' else BusinessTeamName end BusinessTeamName
,CONVERT(NVARCHAR(50),ShipDate,23) DateToday
,SUM(Profits) OperateFeeRMB,SUM(Profits/USD_ExchangeRMB) OperateFeeUSD
,SUM(SalesPrice+TransportPay+SalesRefunds+PromotionRebates+OtherCredits+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0)) SalesPriceFeeRMB
,SUM((SalesPrice+TransportPay+SalesRefunds+PromotionRebates+OtherCredits+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0))/USD_ExchangeRMB) SalesPriceFeeUSD
,SUM(SalesRefunds) FundMoneyRMB
,SUM(SalesRefunds/USD_ExchangeRMB) FundMoneyUSD
,ABS(SUM((CASE WHEN ISNULL(SalesRefunds,0)=0 THEN 0 ELSE ISNULL(SalesRefunds,0)+ISNULL(PromotionRebates,0)+ISNULL(OtherCredits,0)+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0) END))) SalesRefundsV2RMB
,ABS(SUM((CASE WHEN ISNULL(SalesRefunds,0)=0 THEN 0 ELSE ISNULL(SalesRefunds,0)+ISNULL(PromotionRebates,0)+ISNULL(OtherCredits,0)+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0) END)/USD_ExchangeRMB)) SalesRefundsV2USD
from RB_Report_OrderSettlement with(nolock)
where CustomerID=1 and ShipDate>='2025-07-01' and ShipDate<DATEADD(DAY,1,'2025-07-28') and BusinessTeamID in (223) and WareHouseID in (334,332,338,337,339,326,318,319,320,52,59,3483,79,23,40,24,6297,26
仓库
)AS tmporder GROUP BY tmporder.CustomerID,SalesWeek,tmporder.BusinessTeamID,tmporder.BusinessTeamName
) AS ordernum on ordernum.CustomerID=orderfee.CustomerID and ordernum.BusinessTeamID=orderfee.BusinessTeamID and orderfee.BusinessTeamName=ordernum.BusinessTeamName
and ordernum.SalesWeek=orderfee.DateToday
order by orderfee.BusinessTeamID,orderfee.DateToday asc
MESSAGE:The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
TRACE: 在 System.Data.SqlClient.SqlConnection.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.SqlDataReader.TryConsumeMetaData()
在 System.Data.SqlClient.SqlDataReader.get_MetaData()
在 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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
在 GotDotNet.ApplicationBlocks.Data.AdoHelper.ExecuteDataset(IDbCommand command)
在 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlCommand command)
在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB) 在 PandaBuy.ERP.DAL.DBOperator.E8mARE5em(SqlException , String )
在 PandaBuy.ERP.DAL.DBOperator.GetDSExecuteSqlNoTimeOut(String p_Sql, Boolean IsWriteDB)
在 PandaBuy.ERP.Web.ASHX.IrobotBox.SalesTeamDateReportHandler.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
[结果]
[期望]
排查 并修复故障 怎么有这么多 仓库ID 导致SQL异常了
页面是订单利润报表(销售小组),订单利润已切换V2,产品这边安排下关闭菜单入口