Error:11_-2_0_-2146232060
SQL: declare @tb_id as Tb_Ids; INSERT INTO @tb_id SELECT CONVERT(INT, item) FROM dbo.CharSplitForIn('7085,7056,7057,7556,3922,7590,4316,9029,5312,2,279,336,333,687,2205,13237,13558,1100000', ','); SELECT Count(1) FROM RB_WareHouse_Product a WITH ( NOLOCK ) INNER JOIN RB_WareHouse wh WITH ( NOLOCK ) ON a.CustomerID=wh.CustomerID AND a.WareHouseID=wh.ID AND wh.IsActive=1
INNER JOIN RB_WareHouse_OneProductMorePosition_Product whopmpp ( NOLOCK ) ON a.CustomerID=whopmpp.CustomerID AND a.WareHouseID=whopmpp.WareHouseID AND a.SKU=whopmpp.SKU
LEFT JOIN RB_WareHouse_Position AS b WITH ( NOLOCK ) ON whopmpp.PositionID=b.ID AND whopmpp.CustomerID=b.CustomerID
LEFT JOIN RB_Product AS c WITH ( NOLOCK ) ON a.SKU=c.SKU AND a.CustomerID=c.CustomerID
LEFT JOIN (
SELECT ps.CustomerID, SKU,ps.IsFBABarCode
FROM RB_Product_SupplierPrice sp WITH( NOLOCK )
LEFT JOIN RB_Product_Supplier ps WITH( NOLOCK ) ON sp.SupplierID = ps.ID AND sp.CustomerID = ps.CustomerID
WHERE sp.IsDefault = 1 AND ps.IsFBABarCode = 1) s ON a.SKU=s.SKU AND s.CustomerID=a.CustomerID
LEFT JOIN RB_Warehouse_Product_ActiveInfo r WITH(NOLOCK) on a.CustomerID=r.CustomerID AND a.SKU=r.SKU AND a.WarehouseID=r.WarehouseID
LEFT JOIN RB_7DaysOutStockRecord sr WITH(NOLOCK) on a.CustomerID=sr.CustomerID and a.SKU=sr.SKU and a.WareHouseID=sr.WareHouseID
LEFT JOIN RB_Warehouse_PickingPackage pp WITH(NOLOCK) on a.CustomerID=pp.CustomerID and a.SKU=pp.SKU and a.WareHouseID=pp.WareHouseID INNER JOIN @tb_id tid on wh.ID=tid.Id WHERE a.CustomerID=1 AND wh.WareHouseType=1
PARAMS:
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.ExecuteScalar()
在 RB.DAL.DBOperator.GetSingle(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)
在 RB.DAL.DBOperator.GetSingle(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)
在 RB.DAL.DBOperator.GetSingle(String SQLString, Boolean IsWriteDB)
在 RB.DALExtend.Generate.RB_WareHouse_ProductExtend.GetWareHouseProductPositionInfoPagerList(RB_WareHouse_Product_Position_PageList_PSParameters parameters, Int32& recordCount, String& sqlQueryCriteria, Int32& totalGoodNum, Int32& totalLockNum, Decimal& totalInventoryAmount, String& sqlCreateTable)
在 PandaBuy.ERP.Web.IrobotBox.WareHouse.LocalWarehouseInventory.InitProductsData()
在 PandaBuy.ERP.Web.IrobotBox.WareHouse.LocalWarehouseInventory.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_warehouse_localwarehouseinventory_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)
建议优化:
declare @tb_id as Tb_Ids;
INSERT INTO @tb_id SELECT CONVERT(INT, item) FROM dbo.CharSplitForIn('7085,7056,7057,7556,3922,7590,4316,9029,5312,2,279,336,333,687,2205,13237,13558,1100000', ',');
drop table if exists #tabHouse;
select wh.CustomerID,wh.ID into #tabHouse from RB_WareHouse wh WITH ( NOLOCK )
INNER JOIN @tb_id tid on wh.ID=tid.Id
where wh.WareHouseType=1 and wh.IsActive=1;
create index idx_id_CustomerID on #tabHouse(id,CustomerID);
SELECT Count(1) FROM RB_WareHouse_Product a WITH ( NOLOCK )
INNER JOIN #tabHouse wh WITH ( NOLOCK ) ON a.CustomerID=wh.CustomerID AND a.WareHouseID=wh.ID
INNER JOIN RB_WareHouse_OneProductMorePosition_Product whopmpp ( NOLOCK ) ON a.CustomerID=whopmpp.CustomerID AND a.WareHouseID=whopmpp.WareHouseID AND a.SKU=whopmpp.SKU
LEFT JOIN RB_WareHouse_Position AS b WITH ( NOLOCK ) ON whopmpp.PositionID=b.ID AND whopmpp.CustomerID=b.CustomerID
LEFT JOIN RB_Product AS c WITH ( NOLOCK ) ON a.SKU=c.SKU AND a.CustomerID=c.CustomerID
LEFT JOIN (
SELECT ps.CustomerID, SKU,ps.IsFBABarCode
FROM RB_Product_SupplierPrice sp WITH( NOLOCK )
LEFT JOIN RB_Product_Supplier ps WITH( NOLOCK ) ON sp.SupplierID = ps.ID AND sp.CustomerID = ps.CustomerID
WHERE sp.IsDefault = 1 AND ps.IsFBABarCode = 1) s ON a.SKU=s.SKU AND s.CustomerID=a.CustomerID
LEFT JOIN RB_Warehouse_Product_ActiveInfo r WITH(NOLOCK) on a.CustomerID=r.CustomerID AND a.SKU=r.SKU AND a.WarehouseID=r.WarehouseID
LEFT JOIN RB_7DaysOutStockRecord sr WITH(NOLOCK) on a.CustomerID=sr.CustomerID and a.SKU=sr.SKU and a.WareHouseID=sr.WareHouseID
LEFT JOIN RB_Warehouse_PickingPackage pp WITH(NOLOCK) on a.CustomerID=pp.CustomerID and a.SKU=pp.SKU and a.WareHouseID=pp.WareHouseID
WHERE a.CustomerID=1 ;
