July 19, 2011 at 2:15 pm
Hi,
I have a large table with 10 xml columns with large xml data.
Now i want to join those columns to make one main xml which is combination of all xml by using "+" with all columns as cast(varchar(max)).
BUT it do not concat values of all columns and show values from only first 4 columns.
why?
if i copy-paste individual columns to make one xml then merged xml looks fine.
Note: SSMS editor setting for text and xml is already max.
Thanks.
July 19, 2011 at 2:20 pm
check the datalength() of your results instead of viewing the column;
I believe for performance sake, no matter what you set the results setting to in SSMS , it displays(at max) the first 8000 chars, even though the data is larger than that.
you might need to send the results to something other than SSMS to confirm the data is correct.
Lowell
July 19, 2011 at 2:25 pm
Well size of combined one xml is not even 1MB.
Now i have added a new varchar(max) column in the table and did a simple update
update table set new_col = col1+col2+col3+col4+....
now even then its not showing everything in resultant column.
Why?
I have now output the top 1 resultant new column into text file and even then its showing 8192 characters in that file.
What is this setting?
July 19, 2011 at 2:31 pm
test this:
SELECT DATALENGTH(new_col) AS TOTALLENGTH,
DATALENGTH(col1) + DATALENGTH(col2) +DATALENGTH(col3) + DATALENGTH(col4) As ShouldBeEqual
FROM table
I think you'll find that the data in the table is the right size and is correct; it's SSMS not displaying the data to you, and that makes you think the data's invalid when it really is OK.
Lowell
July 19, 2011 at 2:36 pm
Yes you are right. t
The combined datalength(new_resultant_col) is more than 100,000.
But even then i can't see that even in note pad text file.
Why? and how to see such things ?
I wonder why not SSMS?
Thanks,.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply