[步骤]
prometheus告警
开始时间: 16:36:02
错误代码: N1636026
sql类型: DECLARE
sql: [16:36:02] -------------------------------------------------------------
CODE:N1636026
Error:16_8152_30_-2146232060
SQL: DECLARE @ProductSKUS TABLE(SKU VARCHAR(50) primary key); INSERT INTO @ProductSKUS
SELECT SKU FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY ID DESC ) AS [PageIndex], * FROM (
SELECT P.SKU,P.ID FROM dbo.RB_Product (NOLOCK) p LEFT JOIN RB_Product_Admin pa WITH ( NOLOCK ) ON pa.SKU = p.SKU AND pa.CustomerID = p.CustomerID LEFT JOIN RB_WareHouse_Product whp WITH ( NOLOCK ) ON whp.SKU = p.SKU AND whp.CustomerID = p.CustomerID AND whp.WareHouseID = (CASE p.DefaultLocalWarehouse WHEN 0 THEN 5312 WHEN NULL THEN 5312 ELSE p.DefaultLocalWarehouse END) AND EXISTS (SELECT 1 FROM RB_WareHouse WHERE whp.WareHouseID =RB_WareHouse.ID AND whp.CustomerID = RB_WareHouse.CustomerID AND RB_WareHouse.WareHouseType = 1) LEFT JOIN RB_WareHouse wh (NOLOCK) ON p.CustomerID=wh.CustomerID AND p.DefaultLocalWarehouse=wh.ID AND wh.IsActive=1 LEFT JOIN ( SELECT CustomerID , SKU , SUM(BadNum) AS ProductBadNum FROM RB_Procurement_Detail_BadList WITH ( NOLOCK ) WHERE BadNum > 0 AND DType = 1 GROUP BY CustomerID , SKU ) AS RB_Procurement_Detail_BadList ON p.SKU = RB_Procurement_Detail_BadList.SKU AND p.CustomerID = RB_Procurement_Detail_BadList.CustomerID LEFT JOIN ( SELECT CustomerID , SKU , SUM(NumError) AS NumError FROM RB_ProductManageLog WITH ( NOLOCK ) WHERE NumError > 0 GROUP BY CustomerID , SKU ) AS RB_ProductManageLog ON p.SKU = RB_ProductManageLog.SKU AND p.CustomerID = RB_ProductManageLog.CustomerID LEFT JOIN RB_Product_Declaration pd ( NOLOCK ) ON p.CustomerID = pd.CustomerID AND p.SKU = pd.SKU WHERE p.CustomerID =1 AND p.DeleteStatus =0 AND p.SKU IN (Select item from CharSplitForIn('14803100148556971487779014900991149783891470893314840683149151821492364214924688147591831483499914904572149994901487903014901888147308801475285114752972148432061484560114851313149352321495142614959409149104231491842514951745148264401484938514887383149513691495954914978841149799661499321914995570148808021476755514901655149524051498452014803055148398971485949414990215149166581485818114929669149329161464940314819705148418761485115214890253148552021497850414807968149797881491393114966881149842881498819414801734148521361485384114854065148581671489271814910530',','))
) AS TempTable
) AS PagerTable
WHERE PagerTable.[PageIndex] BETWEEN 1 AND 25;
SELECT
ROW_NUMBER() OVER (ORDER BY ID DESC ) AS [PageIndex], * FROM (SELECT p.ID ,
p.CustomerID ,
p.ClientSKU ,
p.SKU ,
p.ProductState ,
p.MinSaleNum ,
p.ImageUrl ,
p.ProductProperty ,
p.WithBattery ,
p.PlugRelate ,
p.PlugRelateType ,
p.ProductGroupSKU ,
p.ProductName ,
p.ProductNameCN ,
p.LastSupplierPrice ,
p.GrossWeight ,
p.UnitShipFee ,
p.LastBuyShipFee ,
p.SalePrice ,
p.PackWeight ,
p.IsGroup ,
p.OnlineStatus ,
p.ComeSource AS ComeSource ,
ISNULL(whp.GoodNum, 0) GoodNum ,
ISNULL(whp.AvgDailySales, 0) AvgDailySales ,
ISNULL(wh.WareHouseName,'') DefaultLocalWarehouseName,
pa.RecommendValue ,
pa.AddAdminID ,
pa.AddAdminName ,
pa.AddTime ,
pa.DevelopmentAuditOperatorName ,
pa.ProductDevelopmentAuditTime ,
pa.EditAuditOperatorName ,
pa.ProductEditAuditTime ,
pa.PictureAuditOperatorName ,
pa.ProductPictureAuditTime ,
pa.IsAmazonSale ,
pa.NoSalePlatform ,
pa.NoSaleCountry ,
pa.DevelopStatus ,
pa.DevelopAdminID ,
pa.DevelopAdminName ,
pa.DevelopTime ,
pa.DevelopRefuseReason ,
pa.DevelopRefuseTime ,
pa.AssignDevelopAdminID ,
pa.AssignDevelopAdminName ,
pa.AssignDevelopTime ,
pa.EditStatus ,
pa.EditAdminID ,
pa.EditAdminName ,
pa.EditTime ,
pa.EditRefuseTime ,
pa.ToImageMemo ,
pa.ImageStatus ,
pa.ImageAdminID ,
pa.ImageAdminName ,
pa.ImageTime ,
pa.ImageRefuseTime ,
pa.BuyerID ,
pa.BuyerName ,
pa.BuyerSetTime ,
pa.CheckStatus ,
pa.CheckReason ,
pa.CheckAdminID ,
pa.CheckAdminName ,
pa.CheckTime ,
pa.OnlineTime ,
pa.OfflineTime ,
pa.OfflineAdminID ,
pa.OfflineAdminName ,
p.TaxPoint ,
p.TaxRate ,
p.IsRawMaterial ,
ISNULL(ProductBadNum, 0) ProductBadNum ,
ISNULL(NumError, 0) NumError ,
p.ProductType ,
ISNULL(p.IsFBABarCode, 0) IsFBABarCode ,
ISNULL(p.IsRecommendOcean, 0) AS IsRecommendOcean ,
pd.DeclarationPriceRate ,
p.IsCheckDeclarationCode ,
p.IsCheckTransport ,
p.LastBuyPrice ,
pa.PriceSpecialistOperatTime ,
ISNULL(p.DefaultLocalWarehouse, 0) AS DefaultLocalWareHouse ,
p.DevelopType ,
p.AppointDevelopType ,
p.PictureSource ,
p.PreclassStatus ,
p.PreclassGoodsCode ,
p.ImitatingBrandRemark,
p.ProductStateRemarks,
p.ClassID1,
p.ClassID2,
p.ClassID,
p.BeginTime,
p.EndTime,
p.ProdutcArrivalDate,
ISNULL(pa.PhotographerId,0) PhotographerId,
ISNULL(pa.PhotographerName,'') PhotographerName,
pa.PhotographerTime,
pa.WrapDesignerId,
pa.WrapDesignerName,
pa.WrapDesignerTime,
pa.ImageDesignerId,
pa.ImageDesignerName,
pa.ImageDesignerTime,
pa.IntellectualPropertyRightsAdminID,
pa.IntellectualPropertyRightsAdminName,
pa.IntellectualPropertyRightsTime,
ISNULL(p.EditNum,0) EditNum,
p.IsNeedCeCertification
FROM (SELECT * FROM dbo.RB_Product (NOLOCK) WHERE SKU IN (SELECT * FROM @ProductSKUS)) p
LEFT JOIN RB_Product_Admin pa WITH ( NOLOCK ) ON pa.SKU = p.SKU
AND pa.CustomerID = p.CustomerID
LEFT JOIN RB_WareHouse_Product whp WITH ( NOLOCK ) ON whp.SKU = p.SKU
AND whp.CustomerID = p.CustomerID
AND whp.WareHouseID = (CASE p.DefaultLocalWarehouse WHEN 0 THEN 5312 WHEN NULL THEN 5312 ELSE p.DefaultLocalWarehouse END) AND EXISTS (SELECT 1 FROM RB_WareHouse WHERE whp.WareHouseID =RB_WareHouse.ID
AND whp.CustomerID = RB_WareHouse.CustomerID AND RB_WareHouse.WareHouseType = 1)
LEFT JOIN RB_WareHouse wh (NOLOCK) ON p.CustomerID=wh.CustomerID AND p.DefaultLocalWarehouse=wh.ID AND wh.IsActive=1
LEFT JOIN ( SELECT CustomerID ,
SKU ,
SUM(BadNum) AS ProductBadNum
FROM RB_Procurement_Detail_BadList WITH ( NOLOCK )
WHERE BadNum > 0
AND DType = 1
GROUP BY CustomerID ,
SKU
) AS RB_Procurement_Detail_BadList ON p.SKU = RB_Procurement_Detail_BadList.SKU
AND p.CustomerID = RB_Procurement_Detail_BadList.CustomerID
LEFT JOIN ( SELECT CustomerID ,
SKU ,
SUM(NumError) AS NumError
FROM RB_ProductManageLog WITH ( NOLOCK )
WHERE NumError > 0
GROUP BY CustomerID ,
SKU
) AS RB_ProductManageLog ON p.SKU = RB_ProductManageLog.SKU
AND p.CustomerID = RB_ProductManageLog.CustomerID
LEFT JOIN RB_Product_Declaration pd ( NOLOCK ) ON p.CustomerID = pd.CustomerID
AND p.SKU = pd.SKU WHERE p.CustomerID =1 AND p.DeleteStatus =0 AND p.SKU IN (Select item from CharSplitForIn('14803100148556971487779014900991149783891470893314840683149151821492364214924688147591831483499914904572149994901487903014901888147308801475285114752972148432061484560114851313149352321495142614959409149104231491842514951745148264401484938514887383149513691495954914978841149799661499321914995570148808021476755514901655149524051498452014803055148398971485949414990215149166581485818114929669149329161464940314819705148418761485115214890253148552021497850414807968149797881491393114966881149842881498819414801734148521361485384114854065148581671489271814910530',','))) AS TempTable;
SELECT COUNT(1) FROM (SELECT P.SKU,P.ID FROM dbo.RB_Product (NOLOCK) p LEFT JOIN RB_Product_Admin pa WITH ( NOLOCK ) ON pa.SKU = p.SKU AND pa.CustomerID = p.CustomerID LEFT JOIN RB_WareHouse_Product whp WITH ( NOLOCK ) ON whp.SKU = p.SKU AND whp.CustomerID = p.CustomerID AND whp.WareHouseID = (CASE p.DefaultLocalWarehouse WHEN 0 THEN 5312 WHEN NULL THEN 5312 ELSE p.DefaultLocalWarehouse END) AND EXISTS (SELECT 1 FROM RB_WareHouse WHERE whp.WareHouseID =RB_WareHouse.ID AND whp.CustomerID = RB_WareHouse.CustomerID AND RB_WareHouse.WareHouseType = 1) LEFT JOIN RB_WareHouse wh (NOLOCK) ON p.CustomerID=wh.CustomerID AND p.DefaultLocalWarehouse=wh.ID AND wh.IsActive=1 LEFT JOIN ( SELECT CustomerID , SKU , SUM(BadNum) AS ProductBadNum FROM RB_Procurement_Detail_BadList WITH ( NOLOCK ) WHERE BadNum > 0 AND DType = 1 GROUP BY CustomerID , SKU ) AS RB_Procurement_Detail_BadList ON p.SKU = RB_Procurement_Detail_BadList.SKU AND p.CustomerID = RB_Procurement_Detail_BadList.CustomerID LEFT JOIN ( SELECT CustomerID , SKU , SUM(NumError) AS NumError FROM RB_ProductManageLog WITH ( NOLOCK ) WHERE NumError > 0 GROUP BY CustomerID , SKU ) AS RB_ProductManageLog ON p.SKU = RB_ProductManageLog.SKU AND p.CustomerID = RB_ProductManageLog.CustomerID LEFT JOIN RB_Product_Declaration pd ( NOLOCK ) ON p.CustomerID = pd.CustomerID AND p.SKU = pd.SKU WHERE p.CustomerID =1 AND p.DeleteStatus =0 AND p.SKU IN (Select item from CharSplitForIn('14803100148556971487779014900991149783891470893314840683149151821492364214924688147591831483499914904572149994901487903014901888147308801475285114752972148432061484560114851313149352321495142614959409149104231491842514951745148264401484938514887383149513691495954914978841149799661499321914995570148808021476755514901655149524051498452014803055148398971485949414990215149166581485818114929669149329161464940314819705148418761485115214890253148552021497850414807968149797881491393114966881149842881498819414801734148521361485384114854065148581671489271814910530',','))) AS TempCount;
PARAMS:
MESSAGE:String or binary data would be truncated.
String or binary data would be truncated.
String or binary data would be truncated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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.DALExtend.RB_ProductExtend.QueryTemporaryTablePagerNew(String sqlDeclare, String sqlRecycle, String SQLString, String strOrder, Int32 pageIndex, Int32 pageSize, Int32& recordCount, Int32 times, SqlParameter[] parameters)
在 RB.DALExtend.RB_ProductExtend.GetModelListV2(CM_GetProductListParam param, Boolean isOpenNewSearch, Int32& recordCount)
在 PandaBuy.ERP.Web.IrobotBox.Product.ProductListV2.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_product_productlistv2_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)
[结果]
[期望]



触发:批量搜索SKU输入一个超长不分割的字符串
改动:根据数据库对应字段长度截断(没什么好的的解决办法)。