重现步骤

[性能问题描述]


[11:50:18]  -------------------------------------------------------------
CODE:N1150184
Error:11_-2_0_-2146232060
SQL: drop table if exists #tabStr0;
                                     drop table if exists #tabStr1;declare @CheckOrderCodeStr0 varchar(max)= '126137,126327',@CheckOrderCodeStr1 varchar(max)= '2015362,2040025,2042668,2067114,2069424,2069425,2074437,2087199,2094296,2097806,2104872,2109126,2115577,2120736,2130342,2133890,2134274,2134913,2135312,2135313,2135987,2143211,2145521,2153722,2156791,2161311,2165261,2165262,2167680,2168017,2173649,2179986,2181067,2183234,2187592,2191155,2194373,2194374,2195424,2195425,2196681,2198010,2198644,2198993,2201676,2226967,2227724,2230453,2230497,2230655,2231553,2232256,2233089,2233965,2235113,2235210,2235356,2235384,2235724,2235928,2236170,2236613,2236632,2236667,2236682,2236730,2236734,2236784,2236835,2236938,2237006,2237104,2237335,2238015,2238198,2238199,2238272,2238414,2238643,2238644,2238688,2238789,2238819,2238939,2238991,2239177,2239250,2239277,2239278,2239279,2239280,2239420,2239452,2239543,2239891,2239904,2239905,2240013,2240074,2240076,2240484,2240573,2241050,2241268,2241437,2241442,2241477,2241490,2241739,2241772,2241818,2242006,2242166,2242167,2242183,2242399,2242493,2242657,2242667,2242670,2242671,2242752,2242757,2242763,2242822,2242889,2242903,2242923,2242924,2242963,2242964,2242970,2242999,2243004,2243005,2243041,2243044,2243110,2243131,2243134,2243386,2243387,2243507,2243546,2243638,2243660,2243791,2243879,2244241,2244481,2244482,2244789,2244799,2244859,2244860,2244861,2245020,2245069,2245259,2245591,2245649,2245846,2245868,2246258,2246293,2246428,2246498,2246499,2247129,2247169,2247586,2247597,2247651,2247659,2247726,2247763,2248053,2248609,2248865,2248894,2248900,2248928,2248959,2249190,2249322,2249471,2249635,2249834,2250182,2250223,2250237,2250578,2250708,2251033,2251048,2251106,2251137,2251138,2251402,2251458,2251521,2251732,2251736,2251764,2251814,2251815,2251827,2251937,2251979,2251980,2252102,2252146,2252151,2252211,2252212,2252213,2252293,2252478,2252548,2252603,2252639,2252714,2252824,2253005,2253022,2253023,2253567,2253575,2253678,2253694,2253915,2253973,2254052,2254144,2254242';create table #tabStr0(id int);
                                     insert into #tabStr0
                                     exec proc_string_split @CheckOrderCodeStr0,',';
                                     create index idx_id on #tabStr0(id);
                                     create table #tabStr1(id int);
                                     insert into #tabStr1
                                     exec proc_string_split @CheckOrderCodeStr1,',';
                                     create index idx_id on #tabStr1(id); 
SELECT * FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY  RemovalOrderCode asc) AS [PageIndex] ,* FROM ( SELECT DISTINCT
                                      0 AS Source,
                                      os.OrderSourceName, 
                                      isnull(os.SourceStatus,0) SourceStatus,
                                      dp.DepartmentName,
                                      rocrsi.ID,
                                      rocr.OrderSourceID,
                                      rocr.RemovalOrderType,
                                      rocr.RemovalOrderCode,
                                      rocrsi.MNSKU,
                                      rocrsi.FNSKU,
                                      rocrsi.SKU,
                                      rocrsi.SellableQuantity,
                                      rocrsi.UnsellableQuantity,
                                      rocrsi.CostDestroyed,
                                      rocrsi.DestroyedAdminName,
                                      rocrsi.JobNo,
                                      rocrsi.Remark,
                                      ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, 
                                      ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,
                                      ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,
                                      ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,
                                      ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,
                                      arod.Disposition,
                                      ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,
                                      ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,
                                      ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,
                                      ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,
                                      ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,
                                      ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,
                                      '' AS Carrier,
                                      '' AS TrackingNumber,
                                      ISNULL(rocrsi.DestructionReason,'') AS DestroyedReason,
                                      ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                               ELSE pro.LastSupplierPrice
                                               END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,
                                      ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                               ELSE pro.LastSupplierPrice
                                      END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) AS TotalPurchasePrice,
                                      ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                               ELSE pro.LastSupplierPrice
                                      END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity)  * (ISNULL(rocrsi.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,
                                      pro.ImageUrl,
                                      pro.ProductNameCN,
                                      isnull( wh.WareHouseName,'')  OverseaWareHouseName,pro.ProductProperty
                               FROM RB_RemovalOrderCreateRecordSkuItems rocrsi (NOLOCK) 
                                    LEFT JOIN RB_RemovalOrderCreateRecord rocr (NOLOCK) 
                                           ON rocrsi.CustomerID = rocr.CustomerID
                                          AND rocrsi.RecordID = rocr.ID
                                    LEFT JOIN RB_Product pro (NOLOCK) 
                                           ON rocrsi.CustomerID = pro.CustomerID
                                          AND rocrsi.SKU = pro.SKU
                                    LEFT JOIN RB_Amazon_Removal_Order_Detail arod with (NOLOCK)
                                           ON rocr.CustomerID = arod.CustomerID
                                          AND rocr.OrderSourceID = arod.OrderSourceID
                                          AND rocr.RemovalOrderCode = arod.OrderID
                                          AND rocrsi.MNSKU = arod.SKU 
                                          AND rocrsi.FNSKU  = arod.FnSKU
                                    LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) 
                                           ON arod.OrderID = rrd.OrderID 
                                          AND arod.OrderSourceID = rrd.OrderSourceID 
                                          AND arod.CustomerID = rrd.CustomerID
                                          AND arod.SKU  = rrd.SellerSKU
                                          AND arod.FnSKU = rrd.FNSKU
                                    LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK) 
                                           ON rocr.CustomerID = rfih.CustomerID 
                                          AND rocr.OrderSourceID = rfih.OrderSourceID
                                          AND rocrsi.MNSKU  = rfih.sku
                                          AND rocrsi.FNSKU = rfih.fnsku
                                          AND convert(date,rocr.AddTime) = convert(date,rfih.[snapshot-date])
                                    LEFT JOIN RB_OrderSource (NOLOCK) os
                                           ON os.CustomerID = rocr.CustomerID 
                                          AND os.ID = rocr.OrderSourceID
                                    LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK)    
                                           ON robe.CustomerID = rocr.CustomerID
                                          AND robe.OrderSourceID = rocr.OrderSourceID
                                          AND robe.RemovalOrderCode = rocr.RemovalOrderCode
                                    LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase
                                           ON rsase.CustomerID = rocrsi.CustomerID 
                                          AND rsase.ReportID = rocrsi.ID
                                    LEFT JOIN RB_Admin (NOLOCK) ra
                                           ON rocrsi.CustomerID = ra.CustomerID
                                          AND rocrsi.DestroyedAdminID = ra.ID
                                    LEFT JOIN RB_Department (nolock) dp
                                           ON ra.CustomerID = dp.CustomerID
                                          AND ra.DepartmentID = dp.ID
                                    left join  RB_WareHouse (nolock) wh
                                           on  rocr.CustomerID = wh.CustomerID
                                          and  rocr.OverseaWareHouseId = wh.ID INNER JOIN #tabStr0 t0 on t0.id = rocrsi.ID  WHERE rocrsi.CustomerID = @CustomerID   AND rsase.AuditSatus = 2  and exists(select  1
                                                 from  RB_OrderSource_SaleAdmin osa (NOLOCK)
                                                where  osa.OrderSourceID = os.ID
                                                  and  osa.CustomerID = 1
                                                  and  osa.AdminID = 3748
                                               ) union all SELECT  DISTINCT
                                       1 AS Source,
                                       os.OrderSourceName, 
                                       isnull(os.SourceStatus,0) SourceStatus,
                                       dp.DepartmentName,
                                       arod.ID,
                                       arod.OrderSourceID,
                                       arod.OrderType AS RemovalOrderType,
                                       arod.OrderID AS RemovalOrderCode,
                                       arod.SKU AS MNSKU,
                                       arod.FnSKU AS FNSKU,
                                       pro.SKU AS SKU,
                                       0 AS SellableQuantity,
                                       0 AS UnsellableQuantity,
                                       ISNULL(arod.CostDestroyed, 0) AS CostDestroyed,
                                       arod.DestroyedAdminName AS DestroyedAdminName,
                                       arod.JobNo AS JobNo,
                                       arod.Remark AS Remark,
                                       ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, 
                                       ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,
                                       ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,
                                       ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,
                                       ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,
                                       arod.Disposition,
                                       ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,
                                       ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,
                                       ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,
                                       ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,
                                       ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,
                                       ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,
                                       '' AS Carrier,
                                       '' AS TrackingNumber,
                                       arod.DestructionReason AS DestroyedReason,
                                       ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                                ELSE pro.LastSupplierPrice
                                                END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,
                                       ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                                ELSE pro.LastSupplierPrice
                                                END ), 0) * (arod.RequestedQuantity) AS TotalPurchasePrice,
                                        ISNULL(( CASE  WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice
                                                ELSE pro.LastSupplierPrice
                                                END ), 0) * (arod.RequestedQuantity)* (ISNULL(arod.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,
                                       pro.ImageUrl,
                                       pro.ProductNameCN,
                                       ISNULL(wh.WareHouseName,'') as OverseaWareHouseName,pro.ProductProperty
                                    FROM RB_Amazon_Removal_Order_Detail arod with (NOLOCK)
                                         LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) 
                                                ON arod.OrderID = rrd.OrderID 
                                               AND arod.OrderSourceID = rrd.OrderSourceID 
                                               AND arod.CustomerID = rrd.CustomerID
                                               AND arod.SKU  = rrd.SellerSKU
                                               AND arod.FnSKU = rrd.FNSKU
                                         LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK)
                                                ON arod.OrderSourceID = rfih.OrderSourceID 
                                               AND arod.CustomerID = rfih.CustomerID
                                               AND arod.SKU  = rfih.sku
                                               AND arod.FnSKU = rfih.fnsku
                                               AND convert(date,arod.AddTime) = convert(date,rfih.[snapshot-date])
                                         LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK)    
                                                ON robe.CustomerID = arod.CustomerID
                                               AND robe.OrderSourceID = arod.OrderSourceID
                                               AND robe.RemovalOrderCode = arod.OrderID
                                         LEFT JOIN RB_OrderSource (nolock) os
                                                ON os.CustomerID = arod.CustomerID 
                                               AND os.ID = arod.OrderSourceID
                                         left join  RB_WareHouse (nolock) wh
                                               on  os.CustomerID = wh.CustomerID
                                               and  os.RemovalOrderDefaultWareHouseID = wh.ID
                                         LEFT JOIN RB_Product_OrderSourceSKU orsku with (NOLOCK) 
                                                ON arod.CustomerID = orsku.CustomerID
                                               AND arod.OrderSourceID = orsku.OrderSourceID 
                                               AND arod.SKU = orsku.OrderSourceSKU 
                                         LEFT JOIN RB_Product pro with (NOLOCK) 
                                                ON orsku.SKU = pro.SKU 
                                               AND orsku.CustomerID = pro.CustomerID
                                         LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase
                                                ON rsase.CustomerID = arod.CustomerID
                                               AND rsase.ReportID = arod.ID
                                         LEFT JOIN RB_Admin (nolock) ra
                                                ON arod.CustomerID = ra.CustomerID
                                               AND arod.DestroyedAdminID = ra.ID
                                         LEFT JOIN RB_Department (nolock) dp
                                                ON ra.CustomerID = dp.CustomerID
                                               AND ra.DepartmentID = dp.ID INNER JOIN #tabStr1 t1 on t1.id = arod.ID  WHERE arod.CustomerID = @CustomerID  AND NOT EXISTS (SELECT 1 FROM  RB_RemovalOrderCreateRecord (nolock) rocr1 
                                                              WHERE rocr1.CustomerID = arod.CustomerID
                                                                    AND rocr1.OrderSourceID = arod.OrderSourceID 
                                                                    AND rocr1.RemovalOrderCode = arod.OrderID) AND rsase.AuditSatus = 2  and exists(select  1
                                                 from  RB_OrderSource_SaleAdmin osa (NOLOCK)
                                                where  osa.OrderSourceID = os.ID
                                                  and  osa.CustomerID = 1
                                                  and  osa.AdminID = 3748
                                               ) ) AS TempTable ) AS  PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 20 drop table if exists #tabStr0;
                                              drop table if exists #tabStr1;
PARAMS:@CustomerID = 1 ,@StartDate = 2023-10-16 ,@EndDate = 2023/10/31 0:00:00 ,
MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。 
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.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.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   在 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, String srcTable)
   在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)   在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)
   在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)
   在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, Int32 times, SqlParameter[] cmdParms)
   在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, SqlParameter[] cmdParms)
   在 RB.DALExtendV2.RB_Amazon_Removal_Order_DetailExtendV2.GetRemoveOrderSKUDetail(CM_GetRemovalOrderCreateRecordSkuItemsParam para, Boolean IsAutoSubmit, Int32& recordCount)
   在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.GetBatchAuditCount()
   在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.Page_Load(Object sender, EventArgs e)
   在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   在 System.Web.UI.Control.OnLoad(EventArgs e)
   在 System.Web.UI.Control.LoadRecursive()
   在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   在 System.Web.UI.Page.ProcessRequest()
   在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   在 System.Web.UI.Page.ProcessRequest(HttpContext context)
   在 ASP.irobotbox_removeorder_removeorderskulist_aspx.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)
   在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
   在 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)

-------------------------------------------------------------

[分析过程]

查看执行计划 慢 在 union 的后面查询语句  RB_Amazon_Removal_Order_Detail arod with (NOLOCK)  没有包含有效的查询条件

[期望结果] 加入一些核心关联或者条件 以提升效率,减少小黄鸡。


历史记录  
  1. 2023-10-30 17:35:53, 由 袁慧斌 创建。
  2. 2023-10-30 21:13:17, 由 李乐同 指派给 程伟。
    修改了 指派给,旧值为 "liletong",新值为 "chengwei"。
  3. 2023-10-31 08:54:36, 由 程伟 指派给 鞠智明。
    修改了 指派给,旧值为 "chengwei",新值为 "juzhiming"。
  4. 2023-10-31 13:45:52, 由 鞠智明 指派给 程伟。
    修改了 指派给,旧值为 "juzhiming",新值为 "chengwei"。
  5. 2023-10-31 14:44:06, 由 袁慧斌 编辑。
    修改了 严重程度,旧值为 "3",新值为 "1"。
    修改了 优先级 ,旧值为 "3",新值为 "1"。
    修改了 重现步骤,区别为:
    002- [11:50:18] -------------------------------------------------------------CODE:N1150184Error:11_-2_0_-2146232060SQL: drop table if exists #tabStr0; drop table if exists #tabStr1;declare @CheckOrderCodeStr0 varchar(max)= '126137,126327',@CheckOrderCodeStr1 varchar(max)= '2015362,2040025,2042668,2067114,2069424,2069425,2074437,2087199,2094296,2097806,2104872,2109126,2115577,2120736,2130342,2133890,2134274,2134913,2135312,2135313,2135987,2143211,2145521,2153722,2156791,2161311,2165261,2165262,2167680,2168017,2173649,2179986,2181067,2183234,2187592,2191155,2194373,2194374,2195424,2195425,2196681,2198010,2198644,2198993,2201676,2226967,2227724,2230453,2230497,2230655,2231553,2232256,2233089,2233965,2235113,2235210,2235356,2235384,2235724,2235928,2236170,2236613,2236632,2236667,2236682,2236730,2236734,2236784,2236835,2236938,2237006,2237104,2237335,2238015,2238198,2238199,2238272,2238414,2238643,2238644,2238688,2238789,2238819,2238939,2238991,2239177,2239250,2239277,2239278,2239279,2239280,2239420,2239452,2239543,2239891,2239904,2239905,2240013,2240074,2240076,2240484,2240573,2241050,2241268,2241437,2241442,2241477,2241490,2241739,2241772,2241818,2242006,2242166,2242167,2242183,2242399,2242493,2242657,2242667,2242670,2242671,2242752,2242757,2242763,2242822,2242889,2242903,2242923,2242924,2242963,2242964,2242970,2242999,2243004,2243005,2243041,2243044,2243110,2243131,2243134,2243386,2243387,2243507,2243546,2243638,2243660,2243791,2243879,2244241,2244481,2244482,2244789,2244799,2244859,2244860,2244861,2245020,2245069,2245259,2245591,2245649,2245846,2245868,2246258,2246293,2246428,2246498,2246499,2247129,2247169,2247586,2247597,2247651,2247659,2247726,2247763,2248053,2248609,2248865,2248894,2248900,2248928,2248959,2249190,2249322,2249471,2249635,2249834,2250182,2250223,2250237,2250578,2250708,2251033,2251048,2251106,2251137,2251138,2251402,2251458,2251521,2251732,2251736,2251764,2251814,2251815,2251827,2251937,2251979,2251980,2252102,2252146,2252151,2252211,2252212,2252213,2252293,2252478,2252548,2252603,2252639,2252714,2252824,2253005,2253022,2253023,2253567,2253575,2253678,2253694,2253915,2253973,2254052,2254144,2254242';create table #tabStr0(id int); insert into #tabStr0 exec proc_string_split @CheckOrderCodeStr0,','; create index idx_id on #tabStr0(id); create table #tabStr1(id int); insert into #tabStr1 exec proc_string_split @CheckOrderCodeStr1,','; create index idx_id on #tabStr1(id);SELECT * FROM (SELECTROW_NUMBER() OVER (ORDER BY RemovalOrderCode asc) AS [PageIndex] ,* FROM ( SELECT DISTINCT 0 AS Source, os.OrderSourceName, isnull(os.SourceStatus,0) SourceStatus, dp.DepartmentName, rocrsi.ID, rocr.OrderSourceID, rocr.RemovalOrderType, rocr.RemovalOrderCode, rocrsi.MNSKU, rocrsi.FNSKU, rocrsi.SKU, rocrsi.SellableQuantity, rocrsi.UnsellableQuantity, rocrsi.CostDestroyed, rocrsi.DestroyedAdminName, rocrsi.JobNo, rocrsi.Remark, ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity, ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity, ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity, ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity, arod.Disposition, ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days, ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days, ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days, ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days, ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays, ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty, '' AS Carrier, '' AS TrackingNumber, ISNULL(rocrsi.DestructionReason,'') AS DestroyedReason, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) AS TotalPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) * (ISNULL(rocrsi.CostDestroyed, 0)/100) AS DestroyAllocatedAmount, pro.ImageUrl, pro.ProductNameCN, isnull( wh.WareHouseName,'') OverseaWareHouseName,pro.ProductProperty FROM RB_RemovalOrderCreateRecordSkuItems rocrsi (NOLOCK) LEFT JOIN RB_RemovalOrderCreateRecord rocr (NOLOCK) ON rocrsi.CustomerID = rocr.CustomerID AND rocrsi.RecordID = rocr.ID LEFT JOIN RB_Product pro (NOLOCK) ON rocrsi.CustomerID = pro.CustomerID AND rocrsi.SKU = pro.SKU LEFT JOIN RB_Amazon_Removal_Order_Detail arod with (NOLOCK) ON rocr.CustomerID = arod.CustomerID AND rocr.OrderSourceID = arod.OrderSourceID AND rocr.RemovalOrderCode = arod.OrderID AND rocrsi.MNSKU = arod.SKU AND rocrsi.FNSKU = arod.FnSKU LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) ON arod.OrderID = rrd.OrderID AND arod.OrderSourceID = rrd.OrderSourceID AND arod.CustomerID = rrd.CustomerID AND arod.SKU = rrd.SellerSKU AND arod.FnSKU = rrd.FNSKU LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK) ON rocr.CustomerID = rfih.CustomerID AND rocr.OrderSourceID = rfih.OrderSourceID AND rocrsi.MNSKU = rfih.sku AND rocrsi.FNSKU = rfih.fnsku AND convert(date,rocr.AddTime) = convert(date,rfih.[snapshot-date]) LEFT JOIN RB_OrderSource (NOLOCK) os ON os.CustomerID = rocr.CustomerID AND os.ID = rocr.OrderSourceID LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) ON robe.CustomerID = rocr.CustomerID AND robe.OrderSourceID = rocr.OrderSourceID AND robe.RemovalOrderCode = rocr.RemovalOrderCode LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase ON rsase.CustomerID = rocrsi.CustomerID AND rsase.ReportID = rocrsi.ID LEFT JOIN RB_Admin (NOLOCK) ra ON rocrsi.CustomerID = ra.CustomerID AND rocrsi.DestroyedAdminID = ra.ID LEFT JOIN RB_Department (nolock) dp ON ra.CustomerID = dp.CustomerID AND ra.DepartmentID = dp.ID left join RB_WareHouse (nolock) wh on rocr.CustomerID = wh.CustomerID and rocr.OverseaWareHouseId = wh.ID INNER JOIN #tabStr0 t0 on t0.id = rocrsi.ID WHERE rocrsi.CustomerID = @CustomerID AND rsase.AuditSatus = 2 and exists(select 1 from RB_OrderSource_SaleAdmin osa (NOLOCK) where osa.OrderSourceID = os.ID and osa.CustomerID = 1 and osa.AdminID = 3748 ) union all SELECT DISTINCT 1 AS Source, os.OrderSourceName, isnull(os.SourceStatus,0) SourceStatus, dp.DepartmentName, arod.ID, arod.OrderSourceID, arod.OrderType AS RemovalOrderType, arod.OrderID AS RemovalOrderCode, arod.SKU AS MNSKU, arod.FnSKU AS FNSKU, pro.SKU AS SKU, 0 AS SellableQuantity, 0 AS UnsellableQuantity, ISNULL(arod.CostDestroyed, 0) AS CostDestroyed, arod.DestroyedAdminName AS DestroyedAdminName, arod.JobNo AS JobNo, arod.Remark AS Remark, ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity, ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity, ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity, ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity, arod.Disposition, ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days, ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days, ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days, ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days, ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays, ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty, '' AS Carrier, '' AS TrackingNumber, arod.DestructionReason AS DestroyedReason, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.RequestedQuantity) AS TotalPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.RequestedQuantity)* (ISNULL(arod.CostDestroyed, 0)/100) AS DestroyAllocatedAmount, pro.ImageUrl, pro.ProductNameCN, ISNULL(wh.WareHouseName,'') as OverseaWareHouseName,pro.ProductProperty FROM RB_Amazon_Removal_Order_Detail arod with (NOLOCK) LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) ON arod.OrderID = rrd.OrderID AND arod.OrderSourceID = rrd.OrderSourceID AND arod.CustomerID = rrd.CustomerID AND arod.SKU = rrd.SellerSKU AND arod.FnSKU = rrd.FNSKU LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK) ON arod.OrderSourceID = rfih.OrderSourceID AND arod.CustomerID = rfih.CustomerID AND arod.SKU = rfih.sku AND arod.FnSKU = rfih.fnsku AND convert(date,arod.AddTime) = convert(date,rfih.[snapshot-date]) LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) ON robe.CustomerID = arod.CustomerID AND robe.OrderSourceID = arod.OrderSourceID AND robe.RemovalOrderCode = arod.OrderID LEFT JOIN RB_OrderSource (nolock) os ON os.CustomerID = arod.CustomerID AND os.ID = arod.OrderSourceID left join RB_WareHouse (nolock) wh on os.CustomerID = wh.CustomerID and os.RemovalOrderDefaultWareHouseID = wh.ID LEFT JOIN RB_Product_OrderSourceSKU orsku with (NOLOCK) ON arod.CustomerID = orsku.CustomerID AND arod.OrderSourceID = orsku.OrderSourceID AND arod.SKU = orsku.OrderSourceSKU LEFT JOIN RB_Product pro with (NOLOCK) ON orsku.SKU = pro.SKU AND orsku.CustomerID = pro.CustomerID LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase ON rsase.CustomerID = arod.CustomerID AND rsase.ReportID = arod.ID LEFT JOIN RB_Admin (nolock) ra ON arod.CustomerID = ra.CustomerID AND arod.DestroyedAdminID = ra.ID LEFT JOIN RB_Department (nolock) dp ON ra.CustomerID = dp.CustomerID AND ra.DepartmentID = dp.ID INNER JOIN #tabStr1 t1 on t1.id = arod.ID WHERE arod.CustomerID = @CustomerID AND NOT EXISTS (SELECT 1 FROM RB_RemovalOrderCreateRecord (nolock) rocr1 WHERE rocr1.CustomerID = arod.CustomerID AND rocr1.OrderSourceID = arod.OrderSourceID AND rocr1.RemovalOrderCode = arod.OrderID) AND rsase.AuditSatus = 2 and exists(select 1 from RB_OrderSource_SaleAdmin osa (NOLOCK) where osa.OrderSourceID = os.ID and osa.CustomerID = 1 and osa.AdminID = 3748 ) ) AS TempTable ) AS PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 20 drop table if exists #tabStr0; drop table if exists #tabStr1;PARAMS:@CustomerID = 1 ,@StartDate = 2023-10-16 ,@EndDate = 2023/10/31 0:00:00 ,MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。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.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.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) 在 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, String srcTable) 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms) 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, Int32 times, SqlParameter[] cmdParms) 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, SqlParameter[] cmdParms) 在 RB.DALExtendV2.RB_Amazon_Removal_Order_DetailExtendV2.GetRemoveOrderSKUDetail(CM_GetRemovalOrderCreateRecordSkuItemsParam para, Boolean IsAutoSubmit, Int32& recordCount) 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.GetBatchAuditCount() 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.Page_Load(Object sender, EventArgs e) 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) 在 System.Web.UI.Control.OnLoad(EventArgs e) 在 System.Web.UI.Control.LoadRecursive() 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 在 System.Web.UI.Page.ProcessRequest(HttpContext context) 在 ASP.irobotbox_removeorder_removeorderskulist_aspx.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) 在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) 在 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)-------------------------------------------------------------
    002+ [11:50:18] -------------------------------------------------------------CODE:N1150184Error:11_-2_0_-2146232060SQL: drop table if exists #tabStr0; drop table if exists #tabStr1;declare @CheckOrderCodeStr0 varchar(max)= '126137,126327',@CheckOrderCodeStr1 varchar(max)= '2015362,2040025,2042668,2067114,2069424,2069425,2074437,2087199,2094296,2097806,2104872,2109126,2115577,2120736,2130342,2133890,2134274,2134913,2135312,2135313,2135987,2143211,2145521,2153722,2156791,2161311,2165261,2165262,2167680,2168017,2173649,2179986,2181067,2183234,2187592,2191155,2194373,2194374,2195424,2195425,2196681,2198010,2198644,2198993,2201676,2226967,2227724,2230453,2230497,2230655,2231553,2232256,2233089,2233965,2235113,2235210,2235356,2235384,2235724,2235928,2236170,2236613,2236632,2236667,2236682,2236730,2236734,2236784,2236835,2236938,2237006,2237104,2237335,2238015,2238198,2238199,2238272,2238414,2238643,2238644,2238688,2238789,2238819,2238939,2238991,2239177,2239250,2239277,2239278,2239279,2239280,2239420,2239452,2239543,2239891,2239904,2239905,2240013,2240074,2240076,2240484,2240573,2241050,2241268,2241437,2241442,2241477,2241490,2241739,2241772,2241818,2242006,2242166,2242167,2242183,2242399,2242493,2242657,2242667,2242670,2242671,2242752,2242757,2242763,2242822,2242889,2242903,2242923,2242924,2242963,2242964,2242970,2242999,2243004,2243005,2243041,2243044,2243110,2243131,2243134,2243386,2243387,2243507,2243546,2243638,2243660,2243791,2243879,2244241,2244481,2244482,2244789,2244799,2244859,2244860,2244861,2245020,2245069,2245259,2245591,2245649,2245846,2245868,2246258,2246293,2246428,2246498,2246499,2247129,2247169,2247586,2247597,2247651,2247659,2247726,2247763,2248053,2248609,2248865,2248894,2248900,2248928,2248959,2249190,2249322,2249471,2249635,2249834,2250182,2250223,2250237,2250578,2250708,2251033,2251048,2251106,2251137,2251138,2251402,2251458,2251521,2251732,2251736,2251764,2251814,2251815,2251827,2251937,2251979,2251980,2252102,2252146,2252151,2252211,2252212,2252213,2252293,2252478,2252548,2252603,2252639,2252714,2252824,2253005,2253022,2253023,2253567,2253575,2253678,2253694,2253915,2253973,2254052,2254144,2254242';create table #tabStr0(id int); insert into #tabStr0 exec proc_string_split @CheckOrderCodeStr0,','; create index idx_id on #tabStr0(id); create table #tabStr1(id int); insert into #tabStr1 exec proc_string_split @CheckOrderCodeStr1,','; create index idx_id on #tabStr1(id);SELECT * FROM (SELECTROW_NUMBER() OVER (ORDER BY RemovalOrderCode asc) AS [PageIndex] ,* FROM ( SELECT DISTINCT 0 AS Source, os.OrderSourceName, isnull(os.SourceStatus,0) SourceStatus, dp.DepartmentName, rocrsi.ID, rocr.OrderSourceID, rocr.RemovalOrderType, rocr.RemovalOrderCode, rocrsi.MNSKU, rocrsi.FNSKU, rocrsi.SKU, rocrsi.SellableQuantity, rocrsi.UnsellableQuantity, rocrsi.CostDestroyed, rocrsi.DestroyedAdminName, rocrsi.JobNo, rocrsi.Remark, ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity, ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity, ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity, ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity, arod.Disposition, ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days, ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days, ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days, ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days, ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays, ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty, '' AS Carrier, '' AS TrackingNumber, ISNULL(rocrsi.DestructionReason,'') AS DestroyedReason, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) AS TotalPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) * (ISNULL(rocrsi.CostDestroyed, 0)/100) AS DestroyAllocatedAmount, pro.ImageUrl, pro.ProductNameCN, isnull( wh.WareHouseName,'') OverseaWareHouseName,pro.ProductProperty FROM RB_RemovalOrderCreateRecordSkuItems rocrsi (NOLOCK) LEFT JOIN RB_RemovalOrderCreateRecord rocr (NOLOCK) ON rocrsi.CustomerID = rocr.CustomerID AND rocrsi.RecordID = rocr.ID LEFT JOIN RB_Product pro (NOLOCK) ON rocrsi.CustomerID = pro.CustomerID AND rocrsi.SKU = pro.SKU LEFT JOIN RB_Amazon_Removal_Order_Detail arod with (NOLOCK) ON rocr.CustomerID = arod.CustomerID AND rocr.OrderSourceID = arod.OrderSourceID AND rocr.RemovalOrderCode = arod.OrderID AND rocrsi.MNSKU = arod.SKU AND rocrsi.FNSKU = arod.FnSKU LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) ON arod.OrderID = rrd.OrderID AND arod.OrderSourceID = rrd.OrderSourceID AND arod.CustomerID = rrd.CustomerID AND arod.SKU = rrd.SellerSKU AND arod.FnSKU = rrd.FNSKU LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK) ON rocr.CustomerID = rfih.CustomerID AND rocr.OrderSourceID = rfih.OrderSourceID AND rocrsi.MNSKU = rfih.sku AND rocrsi.FNSKU = rfih.fnsku AND convert(date,rocr.AddTime) = convert(date,rfih.[snapshot-date]) LEFT JOIN RB_OrderSource (NOLOCK) os ON os.CustomerID = rocr.CustomerID AND os.ID = rocr.OrderSourceID LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) ON robe.CustomerID = rocr.CustomerID AND robe.OrderSourceID = rocr.OrderSourceID AND robe.RemovalOrderCode = rocr.RemovalOrderCode LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase ON rsase.CustomerID = rocrsi.CustomerID AND rsase.ReportID = rocrsi.ID LEFT JOIN RB_Admin (NOLOCK) ra ON rocrsi.CustomerID = ra.CustomerID AND rocrsi.DestroyedAdminID = ra.ID LEFT JOIN RB_Department (nolock) dp ON ra.CustomerID = dp.CustomerID AND ra.DepartmentID = dp.ID left join RB_WareHouse (nolock) wh on rocr.CustomerID = wh.CustomerID and rocr.OverseaWareHouseId = wh.ID INNER JOIN #tabStr0 t0 on t0.id = rocrsi.ID WHERE rocrsi.CustomerID = @CustomerID AND rsase.AuditSatus = 2 and exists(select 1 from RB_OrderSource_SaleAdmin osa (NOLOCK) where osa.OrderSourceID = os.ID and osa.CustomerID = 1 and osa.AdminID = 3748 ) union all SELECT DISTINCT 1 AS Source, os.OrderSourceName, isnull(os.SourceStatus,0) SourceStatus, dp.DepartmentName, arod.ID, arod.OrderSourceID, arod.OrderType AS RemovalOrderType, arod.OrderID AS RemovalOrderCode, arod.SKU AS MNSKU, arod.FnSKU AS FNSKU, pro.SKU AS SKU, 0 AS SellableQuantity, 0 AS UnsellableQuantity, ISNULL(arod.CostDestroyed, 0) AS CostDestroyed, arod.DestroyedAdminName AS DestroyedAdminName, arod.JobNo AS JobNo, arod.Remark AS Remark, ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity, ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity, ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity, ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity, ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity, arod.Disposition, ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days, ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days, ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days, ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days, ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays, ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty, '' AS Carrier, '' AS TrackingNumber, arod.DestructionReason AS DestroyedReason, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.RequestedQuantity) AS TotalPurchasePrice, ISNULL(( CASE WHEN pro.LastBuyPrice > 0 THEN pro.LastBuyPrice ELSE pro.LastSupplierPrice END ), 0) * (arod.RequestedQuantity)* (ISNULL(arod.CostDestroyed, 0)/100) AS DestroyAllocatedAmount, pro.ImageUrl, pro.ProductNameCN, ISNULL(wh.WareHouseName,'') as OverseaWareHouseName,pro.ProductProperty FROM RB_Amazon_Removal_Order_Detail arod with (NOLOCK) LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK) ON arod.OrderID = rrd.OrderID AND arod.OrderSourceID = rrd.OrderSourceID AND arod.CustomerID = rrd.CustomerID AND arod.SKU = rrd.SellerSKU AND arod.FnSKU = rrd.FNSKU LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK) ON arod.OrderSourceID = rfih.OrderSourceID AND arod.CustomerID = rfih.CustomerID AND arod.SKU = rfih.sku AND arod.FnSKU = rfih.fnsku AND convert(date,arod.AddTime) = convert(date,rfih.[snapshot-date]) LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) ON robe.CustomerID = arod.CustomerID AND robe.OrderSourceID = arod.OrderSourceID AND robe.RemovalOrderCode = arod.OrderID LEFT JOIN RB_OrderSource (nolock) os ON os.CustomerID = arod.CustomerID AND os.ID = arod.OrderSourceID left join RB_WareHouse (nolock) wh on os.CustomerID = wh.CustomerID and os.RemovalOrderDefaultWareHouseID = wh.ID LEFT JOIN RB_Product_OrderSourceSKU orsku with (NOLOCK) ON arod.CustomerID = orsku.CustomerID AND arod.OrderSourceID = orsku.OrderSourceID AND arod.SKU = orsku.OrderSourceSKU LEFT JOIN RB_Product pro with (NOLOCK) ON orsku.SKU = pro.SKU AND orsku.CustomerID = pro.CustomerID LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase ON rsase.CustomerID = arod.CustomerID AND rsase.ReportID = arod.ID LEFT JOIN RB_Admin (nolock) ra ON arod.CustomerID = ra.CustomerID AND arod.DestroyedAdminID = ra.ID LEFT JOIN RB_Department (nolock) dp ON ra.CustomerID = dp.CustomerID AND ra.DepartmentID = dp.ID INNER JOIN #tabStr1 t1 on t1.id = arod.ID WHERE arod.CustomerID = @CustomerID AND NOT EXISTS (SELECT 1 FROM RB_RemovalOrderCreateRecord (nolock) rocr1 WHERE rocr1.CustomerID = arod.CustomerID AND rocr1.OrderSourceID = arod.OrderSourceID AND rocr1.RemovalOrderCode = arod.OrderID) AND rsase.AuditSatus = 2 and exists(select 1 from RB_OrderSource_SaleAdmin osa (NOLOCK) where osa.OrderSourceID = os.ID and osa.CustomerID = 1 and osa.AdminID = 3748 ) ) AS TempTable ) AS PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 20 drop table if exists #tabStr0; drop table if exists #tabStr1;PARAMS:@CustomerID = 1 ,@StartDate = 2023-10-16 ,@EndDate = 2023/10/31 0:00:00 ,MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。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.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.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) 在 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, String srcTable) 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms) 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, Int32 times, SqlParameter[] cmdParms) 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, SqlParameter[] cmdParms) 在 RB.DALExtendV2.RB_Amazon_Removal_Order_DetailExtendV2.GetRemoveOrderSKUDetail(CM_GetRemovalOrderCreateRecordSkuItemsParam para, Boolean IsAutoSubmit, Int32& recordCount) 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.GetBatchAuditCount() 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.Page_Load(Object sender, EventArgs e) 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) 在 System.Web.UI.Control.OnLoad(EventArgs e) 在 System.Web.UI.Control.LoadRecursive() 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 在 System.Web.UI.Page.ProcessRequest(HttpContext context) 在 ASP.irobotbox_removeorder_removeorderskulist_aspx.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) 在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) 在 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)-------------------------------------------------------------
    002- <p><br />[11:50:18] -------------------------------------------------------------<br />CODE:N1150184<br />Error:11_-2_0_-2146232060<br />SQL: drop table if exists #tabStr0;<br /> drop table if exists #tabStr1;declare @CheckOrderCodeStr0 varchar(max)= '126137,126327',@CheckOrderCodeStr1 varchar(max)= '2015362,2040025,2042668,2067114,2069424,2069425,2074437,2087199,2094296,2097806,2104872,2109126,2115577,2120736,2130342,2133890,2134274,2134913,2135312,2135313,2135987,2143211,2145521,2153722,2156791,2161311,2165261,2165262,2167680,2168017,2173649,2179986,2181067,2183234,2187592,2191155,2194373,2194374,2195424,2195425,2196681,2198010,2198644,2198993,2201676,2226967,2227724,2230453,2230497,2230655,2231553,2232256,2233089,2233965,2235113,2235210,2235356,2235384,2235724,2235928,2236170,2236613,2236632,2236667,2236682,2236730,2236734,2236784,2236835,2236938,2237006,2237104,2237335,2238015,2238198,2238199,2238272,2238414,2238643,2238644,2238688,2238789,2238819,2238939,2238991,2239177,2239250,2239277,2239278,2239279,2239280,2239420,2239452,2239543,2239891,2239904,2239905,2240013,2240074,2240076,2240484,2240573,2241050,2241268,2241437,2241442,2241477,2241490,2241739,2241772,2241818,2242006,2242166,2242167,2242183,2242399,2242493,2242657,2242667,2242670,2242671,2242752,2242757,2242763,2242822,2242889,2242903,2242923,2242924,2242963,2242964,2242970,2242999,2243004,2243005,2243041,2243044,2243110,2243131,2243134,2243386,2243387,2243507,2243546,2243638,2243660,2243791,2243879,2244241,2244481,2244482,2244789,2244799,2244859,2244860,2244861,2245020,2245069,2245259,2245591,2245649,2245846,2245868,2246258,2246293,2246428,2246498,2246499,2247129,2247169,2247586,2247597,2247651,2247659,2247726,2247763,2248053,2248609,2248865,2248894,2248900,2248928,2248959,2249190,2249322,2249471,2249635,2249834,2250182,2250223,2250237,2250578,2250708,2251033,2251048,2251106,2251137,2251138,2251402,2251458,2251521,2251732,2251736,2251764,2251814,2251815,2251827,2251937,2251979,2251980,2252102,2252146,2252151,2252211,2252212,2252213,2252293,2252478,2252548,2252603,2252639,2252714,2252824,2253005,2253022,2253023,2253567,2253575,2253678,2253694,2253915,2253973,2254052,2254144,2254242';create table #tabStr0(id int);<br /> insert into #tabStr0<br /> exec proc_string_split @CheckOrderCodeStr0,',';<br /> create index idx_id on #tabStr0(id);<br /> create table #tabStr1(id int);<br /> insert into #tabStr1<br /> exec proc_string_split @CheckOrderCodeStr1,',';<br /> create index idx_id on #tabStr1(id);<br />SELECT * FROM (<br />SELECT<br />ROW_NUMBER() OVER (ORDER BY RemovalOrderCode asc) AS [PageIndex] ,* FROM ( SELECT DISTINCT<br /> 0 AS Source,<br /> os.OrderSourceName,<br /> isnull(os.SourceStatus,0) SourceStatus,<br /> dp.DepartmentName,<br /> rocrsi.ID,<br /> rocr.OrderSourceID,<br /> rocr.RemovalOrderType,<br /> rocr.RemovalOrderCode,<br /> rocrsi.MNSKU,<br /> rocrsi.FNSKU,<br /> rocrsi.SKU,<br /> rocrsi.SellableQuantity,<br /> rocrsi.UnsellableQuantity,<br /> rocrsi.CostDestroyed,<br /> rocrsi.DestroyedAdminName,<br /> rocrsi.JobNo,<br /> rocrsi.Remark,<br /> ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity,<br /> ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,<br /> ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,<br /> ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,<br /> ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,<br /> arod.Disposition,<br /> ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,<br /> ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,<br /> ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,<br /> ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,<br /> ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,<br /> ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,<br /> '' AS Carrier,<br /> '' AS TrackingNumber,<br /> ISNULL(rocrsi.DestructionReason,'') AS DestroyedReason,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) AS TotalPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) * (ISNULL(rocrsi.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,<br /> pro.ImageUrl,<br /> pro.ProductNameCN,<br /> isnull( wh.WareHouseName,'') OverseaWareHouseName,pro.ProductProperty<br /> FROM RB_RemovalOrderCreateRecordSkuItems rocrsi (NOLOCK)<br /> LEFT JOIN RB_RemovalOrderCreateRecord rocr (NOLOCK)<br /> ON rocrsi.CustomerID = rocr.CustomerID<br /> AND rocrsi.RecordID = rocr.ID<br /> LEFT JOIN RB_Product pro (NOLOCK)<br /> ON rocrsi.CustomerID = pro.CustomerID<br /> AND rocrsi.SKU = pro.SKU<br /> LEFT JOIN RB_Amazon_Removal_Order_Detail arod with (NOLOCK)<br /> ON rocr.CustomerID = arod.CustomerID<br /> AND rocr.OrderSourceID = arod.OrderSourceID<br /> AND rocr.RemovalOrderCode = arod.OrderID<br /> AND rocrsi.MNSKU = arod.SKU<br /> AND rocrsi.FNSKU = arod.FnSKU<br /> LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK)<br /> ON arod.OrderID = rrd.OrderID<br /> AND arod.OrderSourceID = rrd.OrderSourceID<br /> AND arod.CustomerID = rrd.CustomerID<br /> AND arod.SKU = rrd.SellerSKU<br /> AND arod.FnSKU = rrd.FNSKU<br /> LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK)<br /> ON rocr.CustomerID = rfih.CustomerID<br /> AND rocr.OrderSourceID = rfih.OrderSourceID<br /> AND rocrsi.MNSKU = rfih.sku<br /> AND rocrsi.FNSKU = rfih.fnsku<br /> AND convert(date,rocr.AddTime) = convert(date,rfih.[snapshot-date])<br /> LEFT JOIN RB_OrderSource (NOLOCK) os<br /> ON os.CustomerID = rocr.CustomerID<br /> AND os.ID = rocr.OrderSourceID<br /> LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) <br /> ON robe.CustomerID = rocr.CustomerID<br /> AND robe.OrderSourceID = rocr.OrderSourceID<br /> AND robe.RemovalOrderCode = rocr.RemovalOrderCode<br /> LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase<br /> ON rsase.CustomerID = rocrsi.CustomerID<br /> AND rsase.ReportID = rocrsi.ID<br /> LEFT JOIN RB_Admin (NOLOCK) ra<br /> ON rocrsi.CustomerID = ra.CustomerID<br /> AND rocrsi.DestroyedAdminID = ra.ID<br /> LEFT JOIN RB_Department (nolock) dp<br /> ON ra.CustomerID = dp.CustomerID<br /> AND ra.DepartmentID = dp.ID<br /> left join RB_WareHouse (nolock) wh<br /> on rocr.CustomerID = wh.CustomerID<br /> and rocr.OverseaWareHouseId = wh.ID INNER JOIN #tabStr0 t0 on t0.id = rocrsi.ID WHERE rocrsi.CustomerID = @CustomerID AND rsase.AuditSatus = 2 and exists(select 1<br /> from RB_OrderSource_SaleAdmin osa (NOLOCK)<br /> where osa.OrderSourceID = os.ID<br /> and osa.CustomerID = 1<br /> and osa.AdminID = 3748<br /> ) union all SELECT DISTINCT<br /> 1 AS Source,<br /> os.OrderSourceName,<br /> isnull(os.SourceStatus,0) SourceStatus,<br /> dp.DepartmentName,<br /> arod.ID,<br /> arod.OrderSourceID,<br /> arod.OrderType AS RemovalOrderType,<br /> arod.OrderID AS RemovalOrderCode,<br /> arod.SKU AS MNSKU,<br /> arod.FnSKU AS FNSKU,<br /> pro.SKU AS SKU,<br /> 0 AS SellableQuantity,<br /> 0 AS UnsellableQuantity,<br /> ISNULL(arod.CostDestroyed, 0) AS CostDestroyed,<br /> arod.DestroyedAdminName AS DestroyedAdminName,<br /> arod.JobNo AS JobNo,<br /> arod.Remark AS Remark,<br /> ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity,<br /> ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,<br /> ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,<br /> ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,<br /> ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,<br /> arod.Disposition,<br /> ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,<br /> ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,<br /> ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,<br /> ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,<br /> ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,<br /> ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,<br /> '' AS Carrier,<br /> '' AS TrackingNumber,<br /> arod.DestructionReason AS DestroyedReason,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.RequestedQuantity) AS TotalPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.RequestedQuantity)* (ISNULL(arod.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,<br /> pro.ImageUrl,<br /> pro.ProductNameCN,<br /> ISNULL(wh.WareHouseName,'') as OverseaWareHouseName,pro.ProductProperty<br /> FROM RB_Amazon_Removal_Order_Detail arod with (NOLOCK)<br /> LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK)<br /> ON arod.OrderID = rrd.OrderID<br /> AND arod.OrderSourceID = rrd.OrderSourceID<br /> AND arod.CustomerID = rrd.CustomerID<br /> AND arod.SKU = rrd.SellerSKU<br /> AND arod.FnSKU = rrd.FNSKU<br /> LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK)<br /> ON arod.OrderSourceID = rfih.OrderSourceID<br /> AND arod.CustomerID = rfih.CustomerID<br /> AND arod.SKU = rfih.sku<br /> AND arod.FnSKU = rfih.fnsku<br /> AND convert(date,arod.AddTime) = convert(date,rfih.[snapshot-date])<br /> LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) <br /> ON robe.CustomerID = arod.CustomerID<br /> AND robe.OrderSourceID = arod.OrderSourceID<br /> AND robe.RemovalOrderCode = arod.OrderID<br /> LEFT JOIN RB_OrderSource (nolock) os<br /> ON os.CustomerID = arod.CustomerID<br /> AND os.ID = arod.OrderSourceID<br /> left join RB_WareHouse (nolock) wh<br /> on os.CustomerID = wh.CustomerID<br /> and os.RemovalOrderDefaultWareHouseID = wh.ID<br /> LEFT JOIN RB_Product_OrderSourceSKU orsku with (NOLOCK)<br /> ON arod.CustomerID = orsku.CustomerID<br /> AND arod.OrderSourceID = orsku.OrderSourceID<br /> AND arod.SKU = orsku.OrderSourceSKU<br /> LEFT JOIN RB_Product pro with (NOLOCK)<br /> ON orsku.SKU = pro.SKU<br /> AND orsku.CustomerID = pro.CustomerID<br /> LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase<br /> ON rsase.CustomerID = arod.CustomerID<br /> AND rsase.ReportID = arod.ID<br /> LEFT JOIN RB_Admin (nolock) ra<br /> ON arod.CustomerID = ra.CustomerID<br /> AND arod.DestroyedAdminID = ra.ID<br /> LEFT JOIN RB_Department (nolock) dp<br /> ON ra.CustomerID = dp.CustomerID<br /> AND ra.DepartmentID = dp.ID INNER JOIN #tabStr1 t1 on t1.id = arod.ID WHERE arod.CustomerID = @CustomerID AND NOT EXISTS (SELECT 1 FROM RB_RemovalOrderCreateRecord (nolock) rocr1<br /> WHERE rocr1.CustomerID = arod.CustomerID<br /> AND rocr1.OrderSourceID = arod.OrderSourceID<br /> AND rocr1.RemovalOrderCode = arod.OrderID) AND rsase.AuditSatus = 2 and exists(select 1<br /> from RB_OrderSource_SaleAdmin osa (NOLOCK)<br /> where osa.OrderSourceID = os.ID<br /> and osa.CustomerID = 1<br /> and osa.AdminID = 3748<br /> ) ) AS TempTable ) AS PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 20 drop table if exists #tabStr0;<br /> drop table if exists #tabStr1;<br />PARAMS:@CustomerID = 1 ,@StartDate = 2023-10-16 ,@EndDate = 2023/10/31 0:00:00 ,<br />MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。<br />TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)<br /> 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)<br /> 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)<br /> 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)<br /> 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()<br /> 在 System.Data.SqlClient.SqlDataReader.get_MetaData()<br /> 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean&amp; usedCache, Boolean asyncWrite, Boolean inRetry)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)<br /> 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)<br /> 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)<br /> 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)<br /> 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)<br /> 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)<br /> 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32&amp; recordCount, Int32 times, SqlParameter[] cmdParms)<br /> 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32&amp; recordCount, SqlParameter[] cmdParms)<br /> 在 RB.DALExtendV2.RB_Amazon_Removal_Order_DetailExtendV2.GetRemoveOrderSKUDetail(CM_GetRemovalOrderCreateRecordSkuItemsParam para, Boolean IsAutoSubmit, Int32&amp; recordCount)<br /> 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.GetBatchAuditCount()<br /> 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.Page_Load(Object sender, EventArgs e)<br /> 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)<br /> 在 System.Web.UI.Control.OnLoad(EventArgs e)<br /> 在 System.Web.UI.Control.LoadRecursive()<br /> 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br /> 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br /> 在 System.Web.UI.Page.ProcessRequest()<br /> 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)<br /> 在 System.Web.UI.Page.ProcessRequest(HttpContext context)<br /> 在 ASP.irobotbox_removeorder_removeorderskulist_aspx.ProcessRequest(HttpContext context)<br /> 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()<br /> 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)<br /> 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)<br /> 在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)<br /> 在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)<br /> 在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus&amp; notificationStatus)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /><br />-------------------------------------------------------------<br /></p>
    002+ <p><br />[11:50:18] -------------------------------------------------------------<br />CODE:N1150184<br />Error:11_-2_0_-2146232060<br />SQL: drop table if exists #tabStr0;<br /> drop table if exists #tabStr1;declare @CheckOrderCodeStr0 varchar(max)= '126137,126327',@CheckOrderCodeStr1 varchar(max)= '2015362,2040025,2042668,2067114,2069424,2069425,2074437,2087199,2094296,2097806,2104872,2109126,2115577,2120736,2130342,2133890,2134274,2134913,2135312,2135313,2135987,2143211,2145521,2153722,2156791,2161311,2165261,2165262,2167680,2168017,2173649,2179986,2181067,2183234,2187592,2191155,2194373,2194374,2195424,2195425,2196681,2198010,2198644,2198993,2201676,2226967,2227724,2230453,2230497,2230655,2231553,2232256,2233089,2233965,2235113,2235210,2235356,2235384,2235724,2235928,2236170,2236613,2236632,2236667,2236682,2236730,2236734,2236784,2236835,2236938,2237006,2237104,2237335,2238015,2238198,2238199,2238272,2238414,2238643,2238644,2238688,2238789,2238819,2238939,2238991,2239177,2239250,2239277,2239278,2239279,2239280,2239420,2239452,2239543,2239891,2239904,2239905,2240013,2240074,2240076,2240484,2240573,2241050,2241268,2241437,2241442,2241477,2241490,2241739,2241772,2241818,2242006,2242166,2242167,2242183,2242399,2242493,2242657,2242667,2242670,2242671,2242752,2242757,2242763,2242822,2242889,2242903,2242923,2242924,2242963,2242964,2242970,2242999,2243004,2243005,2243041,2243044,2243110,2243131,2243134,2243386,2243387,2243507,2243546,2243638,2243660,2243791,2243879,2244241,2244481,2244482,2244789,2244799,2244859,2244860,2244861,2245020,2245069,2245259,2245591,2245649,2245846,2245868,2246258,2246293,2246428,2246498,2246499,2247129,2247169,2247586,2247597,2247651,2247659,2247726,2247763,2248053,2248609,2248865,2248894,2248900,2248928,2248959,2249190,2249322,2249471,2249635,2249834,2250182,2250223,2250237,2250578,2250708,2251033,2251048,2251106,2251137,2251138,2251402,2251458,2251521,2251732,2251736,2251764,2251814,2251815,2251827,2251937,2251979,2251980,2252102,2252146,2252151,2252211,2252212,2252213,2252293,2252478,2252548,2252603,2252639,2252714,2252824,2253005,2253022,2253023,2253567,2253575,2253678,2253694,2253915,2253973,2254052,2254144,2254242';create table #tabStr0(id int);<br /> insert into #tabStr0<br /> exec proc_string_split @CheckOrderCodeStr0,',';<br /> create index idx_id on #tabStr0(id);<br /> create table #tabStr1(id int);<br /> insert into #tabStr1<br /> exec proc_string_split @CheckOrderCodeStr1,',';<br /> create index idx_id on #tabStr1(id);<br />SELECT * FROM (<br />SELECT<br />ROW_NUMBER() OVER (ORDER BY RemovalOrderCode asc) AS [PageIndex] ,* FROM ( SELECT DISTINCT<br /> 0 AS Source,<br /> os.OrderSourceName,<br /> isnull(os.SourceStatus,0) SourceStatus,<br /> dp.DepartmentName,<br /> rocrsi.ID,<br /> rocr.OrderSourceID,<br /> rocr.RemovalOrderType,<br /> rocr.RemovalOrderCode,<br /> rocrsi.MNSKU,<br /> rocrsi.FNSKU,<br /> rocrsi.SKU,<br /> rocrsi.SellableQuantity,<br /> rocrsi.UnsellableQuantity,<br /> rocrsi.CostDestroyed,<br /> rocrsi.DestroyedAdminName,<br /> rocrsi.JobNo,<br /> rocrsi.Remark,<br /> ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity,<br /> ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,<br /> ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,<br /> ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,<br /> ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,<br /> arod.Disposition,<br /> ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,<br /> ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,<br /> ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,<br /> ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,<br /> ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,<br /> ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,<br /> '' AS Carrier,<br /> '' AS TrackingNumber,<br /> ISNULL(rocrsi.DestructionReason,'') AS DestroyedReason,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) AS TotalPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (rocrsi.SellableQuantity + rocrsi.UnsellableQuantity) * (ISNULL(rocrsi.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,<br /> pro.ImageUrl,<br /> pro.ProductNameCN,<br /> isnull( wh.WareHouseName,'') OverseaWareHouseName,pro.ProductProperty<br /> FROM RB_RemovalOrderCreateRecordSkuItems rocrsi (NOLOCK)<br /> LEFT JOIN RB_RemovalOrderCreateRecord rocr (NOLOCK)<br /> ON rocrsi.CustomerID = rocr.CustomerID<br /> AND rocrsi.RecordID = rocr.ID<br /> LEFT JOIN RB_Product pro (NOLOCK)<br /> ON rocrsi.CustomerID = pro.CustomerID<br /> AND rocrsi.SKU = pro.SKU<br /> LEFT JOIN RB_Amazon_Removal_Order_Detail arod with (NOLOCK)<br /> ON rocr.CustomerID = arod.CustomerID<br /> AND rocr.OrderSourceID = arod.OrderSourceID<br /> AND rocr.RemovalOrderCode = arod.OrderID<br /> AND rocrsi.MNSKU = arod.SKU<br /> AND rocrsi.FNSKU = arod.FnSKU<br /> LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK)<br /> ON arod.OrderID = rrd.OrderID<br /> AND arod.OrderSourceID = rrd.OrderSourceID<br /> AND arod.CustomerID = rrd.CustomerID<br /> AND arod.SKU = rrd.SellerSKU<br /> AND arod.FnSKU = rrd.FNSKU<br /> LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK)<br /> ON rocr.CustomerID = rfih.CustomerID<br /> AND rocr.OrderSourceID = rfih.OrderSourceID<br /> AND rocrsi.MNSKU = rfih.sku<br /> AND rocrsi.FNSKU = rfih.fnsku<br /> AND convert(date,rocr.AddTime) = convert(date,rfih.[snapshot-date])<br /> LEFT JOIN RB_OrderSource (NOLOCK) os<br /> ON os.CustomerID = rocr.CustomerID<br /> AND os.ID = rocr.OrderSourceID<br /> LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) <br /> ON robe.CustomerID = rocr.CustomerID<br /> AND robe.OrderSourceID = rocr.OrderSourceID<br /> AND robe.RemovalOrderCode = rocr.RemovalOrderCode<br /> LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase<br /> ON rsase.CustomerID = rocrsi.CustomerID<br /> AND rsase.ReportID = rocrsi.ID<br /> LEFT JOIN RB_Admin (NOLOCK) ra<br /> ON rocrsi.CustomerID = ra.CustomerID<br /> AND rocrsi.DestroyedAdminID = ra.ID<br /> LEFT JOIN RB_Department (nolock) dp<br /> ON ra.CustomerID = dp.CustomerID<br /> AND ra.DepartmentID = dp.ID<br /> left join RB_WareHouse (nolock) wh<br /> on rocr.CustomerID = wh.CustomerID<br /> and rocr.OverseaWareHouseId = wh.ID INNER JOIN #tabStr0 t0 on t0.id = rocrsi.ID WHERE rocrsi.CustomerID = @CustomerID AND rsase.AuditSatus = 2 and exists(select 1<br /> from RB_OrderSource_SaleAdmin osa (NOLOCK)<br /> where osa.OrderSourceID = os.ID<br /> and osa.CustomerID = 1<br /> and osa.AdminID = 3748<br /> ) union all SELECT DISTINCT<br /> 1 AS Source,<br /> os.OrderSourceName,<br /> isnull(os.SourceStatus,0) SourceStatus,<br /> dp.DepartmentName,<br /> arod.ID,<br /> arod.OrderSourceID,<br /> arod.OrderType AS RemovalOrderType,<br /> arod.OrderID AS RemovalOrderCode,<br /> arod.SKU AS MNSKU,<br /> arod.FnSKU AS FNSKU,<br /> pro.SKU AS SKU,<br /> 0 AS SellableQuantity,<br /> 0 AS UnsellableQuantity,<br /> ISNULL(arod.CostDestroyed, 0) AS CostDestroyed,<br /> arod.DestroyedAdminName AS DestroyedAdminName,<br /> arod.JobNo AS JobNo,<br /> arod.Remark AS Remark,<br /> ISNULL(arod.RequestedQuantity, 0) AS RequestedQuantity,<br /> ISNULL(arod.CancelledQuantity, 0) AS CancelledQuantity,<br /> ISNULL(arod.DisposedQuantity, 0) AS DisposedQuantity,<br /> ISNULL(arod.ShippedQuantity, 0) AS ShippedQuantity,<br /> ISNULL(arod.InProcessQuantity, 0) AS InProcessQuantity,<br /> arod.Disposition,<br /> ISNULL(rfih.[inv-age-0-to-90-days], 0) AS InvAge0To90Days,<br /> ISNULL(rfih.[inv-age-91-to-180-days], 0) AS InvAge91To180Days,<br /> ISNULL(rfih.[inv-age-181-to-270-days], 0) AS InvAge181To270Days,<br /> ISNULL(rfih.[inv-age-271-to-365-days], 0) AS InvAge271To365Days,<br /> ISNULL(rfih.[inv-age-365-plus-days], 0) AS InvAge365PlusDays,<br /> ISNULL(rrd.ReceivedQty, 0) AS ReceivedQty,<br /> '' AS Carrier,<br /> '' AS TrackingNumber,<br /> arod.DestructionReason AS DestroyedReason,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.DisposedQuantity + arod.ShippedQuantity) AS TotalProcessedPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.RequestedQuantity) AS TotalPurchasePrice,<br /> ISNULL(( CASE WHEN pro.LastBuyPrice &gt; 0 THEN pro.LastBuyPrice<br /> ELSE pro.LastSupplierPrice<br /> END ), 0) * (arod.RequestedQuantity)* (ISNULL(arod.CostDestroyed, 0)/100) AS DestroyAllocatedAmount,<br /> pro.ImageUrl,<br /> pro.ProductNameCN,<br /> ISNULL(wh.WareHouseName,'') as OverseaWareHouseName,pro.ProductProperty<br /> FROM RB_Amazon_Removal_Order_Detail arod with (NOLOCK)<br /> LEFT JOIN RB_Removeorder_ReceiveDetail rrd with (NOLOCK)<br /> ON arod.OrderID = rrd.OrderID<br /> AND arod.OrderSourceID = rrd.OrderSourceID<br /> AND arod.CustomerID = rrd.CustomerID<br /> AND arod.SKU = rrd.SellerSKU<br /> AND arod.FnSKU = rrd.FNSKU<br /> LEFT JOIN RB_FBA_INVENTORY_PLANNING_DATA rfih with (NOLOCK)<br /> ON arod.OrderSourceID = rfih.OrderSourceID<br /> AND arod.CustomerID = rfih.CustomerID<br /> AND arod.SKU = rfih.sku<br /> AND arod.FnSKU = rfih.fnsku<br /> AND convert(date,arod.AddTime) = convert(date,rfih.[snapshot-date])<br /> LEFT JOIN RB_RemovalOrder_BusinessExpand robe (NOLOCK) <br /> ON robe.CustomerID = arod.CustomerID<br /> AND robe.OrderSourceID = arod.OrderSourceID<br /> AND robe.RemovalOrderCode = arod.OrderID<br /> LEFT JOIN RB_OrderSource (nolock) os<br /> ON os.CustomerID = arod.CustomerID<br /> AND os.ID = arod.OrderSourceID<br /> left join RB_WareHouse (nolock) wh<br /> on os.CustomerID = wh.CustomerID<br /> and os.RemovalOrderDefaultWareHouseID = wh.ID<br /> LEFT JOIN RB_Product_OrderSourceSKU orsku with (NOLOCK)<br /> ON arod.CustomerID = orsku.CustomerID<br /> AND arod.OrderSourceID = orsku.OrderSourceID<br /> AND arod.SKU = orsku.OrderSourceSKU<br /> LEFT JOIN RB_Product pro with (NOLOCK)<br /> ON orsku.SKU = pro.SKU<br /> AND orsku.CustomerID = pro.CustomerID<br /> LEFT JOIN RB_RemovalOrder_SkuItem_AuditSatusExtend (NOLOCK) rsase<br /> ON rsase.CustomerID = arod.CustomerID<br /> AND rsase.ReportID = arod.ID<br /> LEFT JOIN RB_Admin (nolock) ra<br /> ON arod.CustomerID = ra.CustomerID<br /> AND arod.DestroyedAdminID = ra.ID<br /> LEFT JOIN RB_Department (nolock) dp<br /> ON ra.CustomerID = dp.CustomerID<br /> AND ra.DepartmentID = dp.ID INNER JOIN #tabStr1 t1 on t1.id = arod.ID WHERE arod.CustomerID = @CustomerID AND NOT EXISTS (SELECT 1 FROM RB_RemovalOrderCreateRecord (nolock) rocr1<br /> WHERE rocr1.CustomerID = arod.CustomerID<br /> AND rocr1.OrderSourceID = arod.OrderSourceID<br /> AND rocr1.RemovalOrderCode = arod.OrderID) AND rsase.AuditSatus = 2 and exists(select 1<br /> from RB_OrderSource_SaleAdmin osa (NOLOCK)<br /> where osa.OrderSourceID = os.ID<br /> and osa.CustomerID = 1<br /> and osa.AdminID = 3748<br /> ) ) AS TempTable ) AS PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 20 drop table if exists #tabStr0;<br /> drop table if exists #tabStr1;<br />PARAMS:@CustomerID = 1 ,@StartDate = 2023-10-16 ,@EndDate = 2023/10/31 0:00:00 ,<br />MESSAGE:执行超时已过期。完成操作之前已超时或服务器未响应。<br />TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)<br /> 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)<br /> 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)<br /> 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)<br /> 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()<br /> 在 System.Data.SqlClient.SqlDataReader.get_MetaData()<br /> 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean&amp; usedCache, Boolean asyncWrite, Boolean inRetry)<br /> 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)<br /> 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)<br /> 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)<br /> 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)<br /> 在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)<br /> 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)<br /> 在 RB.DAL.DBOperator.Query(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)<br /> 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32&amp; recordCount, Int32 times, SqlParameter[] cmdParms)<br /> 在 RB.DAL.DBOperator.QueryPager(String SQLTemporary, String SQLClearTemporary, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32&amp; recordCount, SqlParameter[] cmdParms)<br /> 在 RB.DALExtendV2.RB_Amazon_Removal_Order_DetailExtendV2.GetRemoveOrderSKUDetail(CM_GetRemovalOrderCreateRecordSkuItemsParam para, Boolean IsAutoSubmit, Int32&amp; recordCount)<br /> 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.GetBatchAuditCount()<br /> 在 PandaBuy.ERP.Web.IrobotBox.RemoveOrder.RemoveOrderSKUList.Page_Load(Object sender, EventArgs e)<br /> 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)<br /> 在 System.Web.UI.Control.OnLoad(EventArgs e)<br /> 在 System.Web.UI.Control.LoadRecursive()<br /> 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br /> 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br /> 在 System.Web.UI.Page.ProcessRequest()<br /> 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)<br /> 在 System.Web.UI.Page.ProcessRequest(HttpContext context)<br /> 在 ASP.irobotbox_removeorder_removeorderskulist_aspx.ProcessRequest(HttpContext context)<br /> 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()<br /> 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)<br /> 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)<br /> 在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)<br /> 在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)<br /> 在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus&amp; notificationStatus)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /> 在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)<br /><br />-------------------------------------------------------------</p>
    用户急,如果暂时没有好的方案 能否先提高当前SQL 的 超时时长来处理。
  6. 2023-10-31 18:01:18, 由 鞠智明 添加备注。

    那个执行有的时候都要四五分钟 ,不能直接改那个时间;需要和产品沟通下改逻辑了 

  7. 2023-10-31 18:51:09, 由 程伟 确认Bug。
    修改了 Bug类型 ,旧值为 "",新值为 "performance"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
  8. 2023-10-31 18:51:18, 由 程伟 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决版本,旧值为 "",新值为 "trunk"。
    修改了 解决日期,旧值为 "",新值为 "2023-10-31 18:51:11"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 解决者 ,旧值为 "",新值为 "chengwei"。
  9. 2023-10-31 18:53:28, 由 鞠智明 添加备注。

    超时时间加到了5分钟

  10. 2023-11-01 08:46:00, 由 程伟 指派给 李乐同。
    修改了 指派给,旧值为 "chengwei",新值为 "liletong"。
  11. 2023-11-01 16:58:33, 由 李乐同 指派给 刘超。
    修改了 指派给,旧值为 "liletong",新值为 "liuchao"。
  12. 2023-11-02 17:57:04, 由 刘超 编辑。
    修改了 严重程度,旧值为 "1",新值为 "3"。
    修改了 优先级 ,旧值为 "1",新值为 "3"。
  13. 2023-11-17 09:30:49, 由 刘超 编辑。
    修改了 所属模块,旧值为 "1743",新值为 "1848"。
  14. 2023-11-17 09:53:50, 由 刘超 编辑。
    修改了 所属模块,旧值为 "1848",新值为 "1863"。
  15. 2023-12-12 11:46:31, 由 刘超 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "liuchao",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "liuchao"。
    修改了 关闭日期,旧值为 "",新值为 "2023-12-12 11:46:31"。
所属项目 技术中心-需求池
所属模块 系统运维   性能优化
所属计划
所属迭代
Bug类型 性能问题
严重程度 提示
优先级 P2
Bug状态 已关闭
业务部门
影响功能
开发责任人
测试责任人
解决时效 0
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2023-12-12 11:46:31
截止日期 0000-00-00
上线时间
上线时效
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 袁慧斌 于 2023-10-30 17:35:52
影响环境 577
由谁解决 程伟 于 2023-10-31 18:51:11
解决版本 主干
解决方案 性能问题
由谁关闭 刘超 于 2023-12-12 11:46:31
最后修改 刘超 于 2023-12-12 11:46:31
相关Bug