CODE:N1432363
Error:16_8152_30_-2146232060
SQL:
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tbOrderSourceID') and type='U')
drop table #tbOrderSourceID
create table #tbOrderSourceID
(
Id int primary key
)
insert into #tbOrderSourceID
select item as Id from CharSplitForIn('8521,6457,7745,8415,9043,7189,6458,7744,8502,6587,6258,6257,6255,9686,5398,13804,10796,3000',',')
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tbSKUs') and type='U')
drop table #tbSKUs
create table #tbSKUs
(
Id nvarchar(50) primary key
)
insert into #tbSKUs
select item as Id from CharSplitForIn('https://i.ebayimg.com/images/g/w2AAAOSwe29jkrqG/s-l1600.jpg',',')
SELECT * FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY SalesMoth DESC ) AS [PageIndex] ,* FROM (
SELECT P.ListingProductID,
P.CustomerID,
P.OrderSourceID,
P.SiteCode,
P.ListingBasicID,
P.SKU,
P.OrderSourceSKU,
P.BuyItNowPrice,
P.EnableBestOffer,
B.Duration,
B.EnableTimerPosting,
B.TimerPosting,
P.MinBestOfferPrice,
P.AutoAcceptPrice,
P.Quantity,
P.EAN,
P.UPC,
P.EPID,
P.ParentListingProductID,
P.IsVariation,
P.ProductType,
P.IsPriceStrategy,
P.PriceStrategyID,
P.PriceStrategyName,
B.TagName,
B.ItemID,
B.ListingType,
B.ProductTitle,
B.ProductSubTitle,
B.AuctionStartPrice,
B.AuctionReservePrice,
B.AuctionBuyItNowPrice,
B.Brand,
B.BrandMPN,
B.ClassID1,
B.ClassID2,
B.StoreClass1,
B.StoreClass2,
B.StoreURL,
B.StartTime,
B.FbaOrderSourceSKU,
B.EndTime,
Isnull(B.UpdateStatus, 0) UpdateStatus,
B.ViewItemURL,
B.AddTime,
B.AdminID,
B.AdminName,
B.UpdateTime,
B.UpdateAdminID,
B.UpdateAdminName,
B.AddItemAdminID,
B.AddItemAdminName,
B.SellerAdminID,
B.SellerAdminName,
B.AddItemFee,
B.OnlineState,
B.Visits,
B.RowVersion,
B.SyncTime,
B.IsSync,
ISNULL(B.QuantitySold,0) QuantitySold,
OS.OrderSourceName,
'' ClientSKU,
'' ProductNameCN,
NULL ProductState,
Isnull(ASP.EnableAutoSupplement, 0) EnableAutoSupplement,
Isnull(ASP.IsInventoryCheck, 0) IsInventoryCheck,
ASP.ListingQty,
ASP.SupplementaryQty,
B.Warehouse,
ELS.SiteCountry,
country.CountryDescription,
Isnull(LSA.SalesToday, 0) AS SalesToday,
Isnull(LSA.SalesYesterDay, 0) AS SalesYesterDay,
Isnull(LSA.SalesBeforeDay, 0) AS SalesBeforeDay,
Isnull(LSA.SalesMoth, 0) AS SalesMoth,
Isnull(LSA.SalesDayTrend, 0) AS SalesDayTrend,
Isnull(LSA.ViewsToday, 0) AS ViewsToday,
Isnull(LSA.ViewsYesterDay, 0) AS ViewsYesterDay,
Isnull(LSA.ViewsBeforeDay, 0) AS ViewsBeforeDay,
Isnull(LSA.ViewsMoth, 0) AS ViewsMoth,
Isnull(LSA.ViewsDayTrend, 0) AS ViewsDayTrend,
Isnull(ESSA.SalesWeek, 0) AS SalesWeekSKU,
Isnull(ESSA.SalesTwoWeek, 0) AS SalesTwoWeekSKU,
Isnull(ESSA.SalesMoth, 0) AS SalesMothSKU,
Isnull(ESSA.SalesThreeMoth, 0) AS SalesThreeMothSKU,
CASE
WHEN Isnull(LSA.ViewsToday, 0) = 0 THEN 0
ELSE Round(CONVERT(FLOAT, Isnull(LSA.SalesToday, 0)) / CONVERT(FLOAT, LSA.ViewsToday), 4) * 100
END AS RoiToday,
CASE
WHEN Isnull(LSA.ViewsYesterDay, 0) = 0 THEN 0
ELSE Round(CONVERT(FLOAT, Isnull(LSA.SalesYesterDay, 0)) / CONVERT(FLOAT, LSA.ViewsYesterDay), 4) * 100
END AS RoiYesterDay,
CASE
WHEN Isnull(LSA.ViewsBeforeDay, 0) = 0 THEN 0
ELSE Round(CONVERT(FLOAT, Isnull(LSA.SalesBeforeDay, 0)) / CONVERT(FLOAT, LSA.ViewsBeforeDay), 4) * 100
END AS RoiBeforeDay,
CASE
WHEN Isnull(LSA.ViewsMoth, 0) = 0 THEN 0
ELSE Round(CONVERT(FLOAT, Isnull(LSA.SalesMoth, 0)) / CONVERT(FLOAT, LSA.ViewsMoth), 4) * 100
END AS RoiMoth,
0 SkuCount,
B.BidCount,
B.BidCurrentPrice,
P.OriginalRetailPrice,
B.MarkdownPromotionID,
B.MarkdownPromotionName,
B.MarkdownPromotionDisCountName,
B.MarkdownPromotionStartDate,
B.MarkdownPromotionEndDate,
B.MarkdownPromotionDisCountID,
MK.PromotionStatus as MKPromotionStutas
,Isnull(ELPS.SKUAvailableInventory, 0) AS SKUAvailableInventory,
Isnull(ELPS.SKUSales, 0) AS SKUSales,
Isnull(ELPS.OrderSourceSKUSales, 0) AS OrderSourceSKUSales,
Isnull(ELPS.ProcurementNum, 0) AS ProcurementNum,
Isnull(ELPS.TransportNum, 0) AS TransportNum,
Isnull(ELPS.BuyerPrice, 0) AS BuyerPrice,
Isnull(ELPS.NeedReplenishment, 0) AS NeedReplenishment,
Isnull(ELPS.SkuEstimateSaleDay, 0) AS SkuEstimateSaleDay
FROM RB_Ebay_Listing_Basic_V2 AS B WITH (NOLOCK)
INNER JOIN #tbOrderSourceID OrderSourceIDs ON B.OrderSourceID=OrderSourceIDs.Id
left JOIN RB_Ebay_Listing_Product_V2 AS P WITH (NOLOCK)
ON B.CustomerID = P.CustomerID
AND B.ListingBasicID = P.ListingBasicID
AND B.OrderSourceID = P.OrderSourceID
AND B.SiteCode = P.SiteCode
left JOIN RB_Ebay_Listing_Sale_Attach_V2 LSA WITH (NOLOCK)
ON LSA.CustomerID = P.CustomerID
AND LSA.ListingBasicID = p.ListingBasicID
AND LSA.OrderSourceID = p.OrderSourceID
LEFT OUTER JOIN RB_OrderSource AS OS WITH (NOLOCK)
ON B.CustomerID = OS.CustomerID
AND B.OrderSourceID = OS.ID
LEFT JOIN RB_Ebay_Listing_AutoSupplement_V2 ASP WITH (NOLOCK)
ON ASP.CustomerID = P.CustomerID
AND ASP.ListingBasicID = P.ListingBasicID
AND ASP.ListingProductID = P.ListingProductID
AND ASP.OrderSourceID = P.OrderSourceID
AND ASP.SiteCode = P.SiteCode
LEFT JOIN RB_Ebay_SKU_Sale_Attach_V2 ESSA WITH (NOLOCK)
ON ESSA.SKU = P.SKU
AND ESSA.CustomerID = P.CustomerID
LEFT JOIN RB_Ebay_Listing_Shipping_V2 ELS WITH(NOLOCK)
ON B.ListingBasicID=ELS.ListingBasicID
AND B.CustomerID=ELS.CustomerID
LEFT JOIN E_Ebay_Country_V2 country (NOLOCK)
ON country.Country = ELS.SiteCountry
LEFT JOIN RB_Ebay_Listing_Markdown_Promotion MK WITH(NOLOCK)
ON MK.CustomerID=P.CustomerID
AND MK.ID=B.MarkdownPromotionID
LEFT JOIN RB_Ebay_Listing_Product_Sales_V2 ELPS WITH(NOLOCK)
ON ELPS.CustomerID = P.CustomerID
AND ELPS.ListingBasicID = P.ListingBasicID
AND ELPS.ListingProductID = P.ListingProductID
AND ELPS.SKU = P.SKU
AND ELPS.OrderSourceID = P.OrderSourceID
WHERE P.CustomerID = @CustomerID
AND P.IsVariation = 0 AND (EXISTS(SELECT NULL
FROM RB_Ebay_Listing_Product_V2 (NOLOCK) PSKU
INNER JOIN #tbSKUs SKUs ON PSKU.SKU=SKUs.Id
WHERE PSKU.CustomerID = B.CustomerID
AND PSKU.SiteCode = B.SiteCode
AND PSKU.OrderSourceID = B.OrderSourceID
AND PSKU.ListingBasicID = B.ListingBasicID) ) AND B.OnlineState=1 ) AS TempTable ) AS PagerTable WHERE PagerTable.[PageIndex] BETWEEN 1 AND 100 option(maxdop 8)
PARAMS:@CustomerID = 1 ,
MESSAGE:String or binary data would be truncated.
The statement has been terminated.
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.Query(String SQLString, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)
在 RB.DALExtend.RB_Ebay_Listing_Product_V2Extend.GetPagerListNew(CM_GetEbayListingPageListParam parameters, Int32& recordCount)
在 PandaBuy.ERP.Web.IrobotBox.EbayV2.ListingList.GetListingPageList()
在 PandaBuy.ERP.Web.IrobotBox.EbayV2.ListingList.OnPreInit(EventArgs e)
在 System.Web.UI.Page.PerformPreInit()
在 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_ebayv2_listinglist_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)
重现步骤