August 5, 2008 at 12:21 pm
The error is saying that some of your data IS being truncated which means that the length of either name or desc in the statecodes table is not set long enough or you have trailing spaces on the end of the data in the XML. Try doing RTRIM(LTRIM(columnname)) on the character columns and if that doesn't work you are either going to have to expand the offending column or use Substring(columnname, 1, defined column length) and lose some data.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 5, 2008 at 1:32 pm
i tried doing rtim(ltrim(column name)) but that didnt work. it gave an error: "Argument data type ntext is invalid for argument 1 of ltrim function." since the text data was of 'ntext' datatype, i guess it could not be used with rtrim,ltrim and len functions. But when i tried using substring function, it worked. so went ahead and expaned the column.
It worked that way :):)
August 5, 2008 at 1:40 pm
I didn't know that the column was ntext. You could convert that to nvarchar(4000) (sql 2000) or nvarchar(max) (Sql 2005) and the the trim functions will work.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply