February 28, 2017 at 3:41 pm
When will most of the time this error comes?
'String or binary data would be truncated'
February 28, 2017 at 4:04 pm
mcfarlandparkway - Tuesday, February 28, 2017 3:41 PMWhen will most of the time this error comes?
'String or binary data would be truncated'
Usually when a column size is to small for the length of a string. Like inserting "abcdefghi" into a column defined as varchar(2).
Sue
February 28, 2017 at 4:15 pm
But source and destination table has both same sizes..
nvarchar(1000).
I checked the len of the text - totalsize is 271 including with spaces,comma and hifens.
Before Inserting data form source to destination we are checking-- Select SUBSTRING(@text,1,CHARINDEX(@text,1)-1),
When I executed this statement i have received error - invalid length passed to the substring
Immediately it entered into catch block and captured the error.
February 28, 2017 at 4:47 pm
mcfarlandparkway - Tuesday, February 28, 2017 4:15 PMBut source and destination table has both same sizes..
nvarchar(1000).I checked the len of the text - totalsize is 271 including with spaces,comma and hifens.
Before Inserting data form source to destination we are checking-- Select SUBSTRING(@text,1,CHARINDEX(@text,1)-1),
When I executed this statement i have received error - invalid length passed to the substring
Immediately it entered into catch block and captured the error.
You need to check your string functions. You're searching 1 for the value of @text.
From BOL: CHARINDEX ( expressionToFind , expressionToSearch [ , start_location ] )
Sue
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply