I'm running this SQL statement
exec sp_executesql
N'UPDATE dbo.PricingProfileRuleSetCondition
SET RuleGroup = @p0,
JoinClause = @p1,
ColumnName = @p2,
Operator = @p3,
Value = @p4,
RuleSetId = @p5
WHERE Id = @p6',
N' @p0 int,
@p1 nvarchar(4000),
@p2 nvarchar(4000),
@p3 nvarchar(4000),
@p4 nvarchar(4000),
@p5 bigint,
@p6 bigint'
,
@p0=0,
@p1=N'And',
@p2=N'DMS.Finance.Entities.PartnerAccountTransactionAmountType.EnglishName',
@p3=N'eq',
@p4=N'dsaf',
@p5=4,
@p6=6
and I'm getting
Msg 8152, Level 16, State 2, Line 1
String or binary data would be truncated.
The statement has been terminated.
help,please
Using ApexSQL Refactor, all SQL statements can be terminated with a semicolon to prevent syntax mistakes in future versions of SQL Server and format SQL code and scripts to comply with the SQL formatting rules.
By default, SQL statements are terminated with semicolons.
To fix this error, patch to SQL Server 2016 SP2, CU6 or newer (including SQL Server 2017), and then turn on trace flag 460. You can enable it at the query level or at the server level.
To avoid this error and to insert the string with truncation, use the ANSI_WARNINGS option. On setting ANSI_WARNINGS to OFF, the error message will not be displayed and the data will be automatically truncated to the length of the destination column and inserted.
A string you are trying to insert is longer than the max nr of charachters. E.g. like a string with 4001 charachters in a varchar(4000) datatype.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With