Good day
Discovers a strange phenomenon - when you try to make a change in the varchar (1)
I get an error The statement has been terminated.String or binary data would be truncated.
Began to understand, and saw the following:
DBMonitor
SQL
UPDATE Report .. SaleTic
SET
et =?
WHERE
idSaletic =?
Params
et IN String [1] 'Y' That's right
Old_idSaletic IN integer 15037
But there is an error message
Error
The statement has been terminated.
String or binary data would be truncated.
However, SQL Profiler can see the following
SQL Profiler
exec sp_executesql N'UPDATE Report .. SaleTic
SET
et = @ P1
WHERE
FS = @ P2 AND idSaletic = @ P3 ', N' @ P1 varchar (2), @ P2 varchar (10), @ P3 int ',' Y ','6110610064', 15037
That is why it decided that it is varchar (2), has an extra space ....
Option TrimVarChar set to true or false, no effect ....
BUT
When working with fields in length to more than 1, all right ...
Here is an example
DBMonitor
UPDATE Report .. SaleTic
SET
FS =?
WHERE
FS =? AND idSaletic =?
FS IN String [10]'6110610064 '
Old_FS IN String [10]'7110610064 '
Old_idSaletic IN integer 15037
SQL Profiler
exec sp_executesql N'UPDATE Report .. SaleTic
SET
FS = @ P1
WHERE
FS = @ P2 AND idSaletic = @ P3 ', N' @ P1 varchar (10), @ P2 varchar (10), @ P3 int ',' 7110610064 ','6110610064', 15037
Yes there is one thing the field named BCO (highlighted in red) varchar (3), DBMonitore see everything correctly, but the SQL Profiler
paints as varchar (6), but still shows the debris field, ie value of field 'E', as drawn 'E and 02'
exec sp_executesql N'UPDATE Report .. SaleTic
SET
et = @ P1
WHERE
AGCOD = @ P2 AND DD = @ P3 AND BCO = @ P4 AND FS = @ P5 AND NPAS = @ P6 AND IND = @ P7 AND NPOS = @ P8 AND idSaletic = @ P9 ', N' @ P1 varchar (2) @ P2 varchar (4), @ P3 datetime, @ P4 varchar (6), @ P5 varchar (10), @ P6 varchar (14), @ P7 varchar (6), @ P8 int, @ P9 int ',' Y ',' a005 ','2009-02-18 00:00:00:000', 'E and 02','6110610064 ',' KIM / Adolf H-H ',' naxb02 ', 923,15037
Version SDAC 4.70.0.44
SQL 2005 SP3
C + + Builder 2009 Update 2