CipherIS
asked on
SQL get larege xml data from database field
I have xml value in a field in a database. I want to look at "all" the data. I want to copy it and past it in NotePad++. When I write a select statement and copy what is in the field it is truncating the data.
How do you write a select so I can get everything in that field?
How do you write a select so I can get everything in that field?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you sending the query results to Text or Grid?
Can you also check the length of the field?
Can you also check the length of the field?
SELECT LEN(XMLField)
FROM YourTableName
WHERE <YourCriteria>
ASKER
I tried the Len on my select statement on the XML field but received the below error.
Msg 8116, Level 16, State 1, Line 5
Argument data type text is invalid for argument 1 of len function.
Msg 8116, Level 16, State 1, Line 5
Argument data type text is invalid for argument 1 of len function.
You'll need to cast it to a string type in order to get the length (see my previous post):
CAST(XMLField AS VARCHAR(MAX))
Oh, is a Text field. Then follow Grendel's suggestion to convert it to VARCHAR(MAX).
ASKER
I used the below code and it still seems to be cutting it off.
CAST(XMLField AS VARCHAR(MAX))
ASKER