[步骤]
开始时间:11:21:23
错误代码: N1121231
错误信息: 16_8152_30_-2146232060
SQL类型: INSERT
错误类型: String_or_binary_data_would_be_truncated
SQL语句: [11:21:23] -------------------------------------------------------------
CODE:N1121231
Error:16_8152_30_-2146232060
SQL:insert into [RB_OrderInfo_BlackList]( [Email] ,[Address], [Phone] ,[IP],[OrderCode],[CardNo],[Reason],[AdminID],[AdminName],[AddTime],[UpdateAdminID],[UpdateAdminName],[UpdateTime],[CustomerID],[ClientUserAccount],[Sku]) values (@Email,@Address,@Phone,@IP,@OrderCode,@CardNo,@Reason,@AdminID,@AdminName,@AddTime,@UpdateAdminID,@UpdateAdminName,@UpdateTime,@CustomerID,@ClientUserAccount,@Sku) ;select @@IDENTITY
PARAMS:@Email = ,@Address = Michelle CHICAGO, IL 60609-1404 ,@Phone = ,@IP = ,@OrderCode = 113-4561671-4816228,113-0247777-5091421,113-5494897-8357032 ,@CardNo = ,@Reason = Amazon律所测试单,25-cv-00437 ,@AdminID = 1976 ,@AdminName = 贾旭杨 ,@AddTime = 2025/2/11 11:21:23 ,@UpdateAdminID = 1976 ,@UpdateAdminName = 贾旭杨 ,@UpdateTime = 2025/2/11 11:21:23 ,@CustomerID = 1 ,@ClientUserAccount = David ,@Sku = B0CYY4JSZP ,
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.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.DALExtendV3.Generate.RB_OrderInfo_BlackListExtendV3.Add(RB_OrderInfo_BlackList model)
在 PandaBuy. ERP .Web.IrobotBox.Order.BlackListEdit.Save(RB_OrderInfo_BlackList model)
在 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.ProcessRequest(HttpContext context)
在 ASP.irobotbox_order_blacklistedit_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.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)
[结果]
[期望]
加强校验,不让错误值报错
1.ordercode长度不够 修改ordercode长度
ALTER TABLE RB_OrderInfo_BlackList ALTER COLUMN OrderCode VARCHAR(5000);