重现步骤

[步骤]


[14:53:35]  -------------------------------------------------------------
CODE:N14533574
Error:14_2627_1_-2146232060
SQL: if  exists ((select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tmpSubsidyPlanIDs') and type='U')) 
                                                       drop table if exists #tmpSubsidyPlanIDs;
                                                create table #tmpSubsidyPlanIDs (Id int primary key) 
                                                INSERT INTO #tmpSubsidyPlanIDs 
 SELECT CONVERT(INT, item) AS Id
 FROM   Charsplitforin(@IDs, ',')   SELECT S.ID,S.SubsidyPlanGUID,S.SKU
                           FROM   RB_SellerSKU_SubsidyPlan (nolock) AS S
                           INNER Join  #tmpSubsidyPlanIDs as IDs ON S.ID = IDs.Id
                           WHERE  CustomerID = @CustomerID
                           
PARAMS:@CustomerID = 1 ,@IDs = 1035588,845693,759145,760890,1259056,1259068,1699335,1700081,1700589,1700521,1701103,1701190,1666578,1667707,1666889,1668345,1702157,1702056,1702158,1703424,1703734,1703680,764042,1263396,955304,799639,1704273,1704532,1704573,1705420,1705279,1705574,1705583,1705651,1707179,1713451,986642,1713721,1714661,1717307,1707368,1708142,1708636,1709011,1709128,632406,1273086,1370297,1569347,957037,1003751,1003752,1000646,1015716,1013979,1036483,1573461,1376220,1379176,634231,779253,1202200,1381769,1383930,962051,1021849,1577007,825950,1385199,1387636,965102,1017696,1017697,1199610,1197155,1393107,1040791,1035003,1588676,1300038,1300866,1301114,653527,1395871,1185248,1401694,1402183,1404359,1403960,1404154,972091,1182540,1181615,1177561,1176384,831429,666524,830162,1501136,1152464,1597810,1598725,1598755,1600925,1601148,1311524,1175361,1175287,1175266,1168894,977275,978894,1033134,1508625,1406043,1406176,1406901,1407773,1408670,1408818,1409454,664807,663683,839815,839354,1601975,1602917,1602929,1312661,1317308,1038507,1412265,1413316,837430,673075,905115,1608108,1608740,1611951,1340712,1340712,1520531,1415752,1417387,1419245,1419564 ,
MESSAGE:Violation of PRIMARY KEY constraint 'PK__#tmpSubs__3214EC0741764A3B'. Cannot insert duplicate key in object 'dbo.#tmpSubsidyPlanIDs'. The duplicate key value is (1340712).
The statement has been terminated.
TRACE:   在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   在 System.Data.SqlClient.SqlDataReader.get_MetaData()
   在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, 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.DALExtendV2.RB_SellerSKU_SubsidyPlanExtendV2.GetSubsidyPlanListByIDs(Int32 customerID, List`1 ids)
   在 Biz.Irobotbox.ClearStorehouse.GenerateClearStockSKUV2.UpdateClearStockSkuStatus(Int32 customerID)
   在 Biz.Irobotbox.ClearStorehouse.GenerateClearStockSKUV2.<Execute>b__0_0(Int32 customerID)
   在 System.Collections.Generic.List`1.ForEach(Action`1 action)
   在 ChinaDownLoadImage.Task.ClearStorehouse.Task_GenerateClearStockSKUV2.Execute()
   在 RB.Utility.SystemTask.<doTask>b__43_0()
   在 System.Threading.Tasks.Task.Execute()
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   在 System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   在 System.Threading.ThreadPoolWorkQueue.Dispatch()


[结果]


[期望]

不报错 


历史记录  
  1. 2023-03-08 15:23:34, 由 袁慧斌 创建。
  2. 2023-03-08 15:28:04, 由 胡晓龙 指派给 王翔宇。
    修改了 指派给,旧值为 "huxiaolong",新值为 "wangxiangyu"。
  3. 2023-03-08 16:23:26, 由 王翔宇 指派给 彭康。
    修改了 指派给,旧值为 "wangxiangyu",新值为 "pengkang"。
  4. 2023-03-08 16:58:31, 由 彭康 解决,方案为 程序BUG 。
    修改了 解决方案,旧值为 "",新值为 "code"。
    修改了 解决版本,旧值为 "",新值为 "657"。
    修改了 解决日期,旧值为 "",新值为 "2023-03-08 16:58:07"。
    修改了 指派给 ,旧值为 "pengkang",新值为 "yuanhuibin"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "pengkang"。
    已去重
  5. 2023-03-14 09:41:16, 由 袁慧斌 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "yuanhuibin",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "yuanhuibin"。
    修改了 关闭日期,旧值为 "",新值为 "2023-03-14 09:41:16"。
  6. 2023-11-17 09:31:04, 由 刘超 编辑。
    修改了 所属模块,旧值为 "1743",新值为 "1848"。
  7. 2023-11-17 09:53:54, 由 刘超 编辑。
    修改了 所属模块,旧值为 "1848",新值为 "1863"。
所属项目 技术中心-需求池
所属模块 系统运维   性能优化
所属计划
所属迭代
Bug类型
严重程度 严重
优先级 P0
Bug状态 已关闭
业务部门
影响功能
开发责任人
测试责任人
解决时效 0
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2023-03-14 09:41:16
截止日期 0000-00-00
上线时间
上线时效
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 袁慧斌 于 2023-03-08 15:23:34
影响环境 577
由谁解决 彭康 于 2023-03-08 16:58:07
解决版本 三月分支
解决方案 程序BUG
由谁关闭 袁慧斌 于 2023-03-14 09:41:16
最后修改 刘超 于 2023-11-17 09:53:48
相关Bug