Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select all of an NVARCHAR(MAX) column's contents

Status
Not open for further replies.

RRinTetons

IS-IT--Management
Jul 4, 2001
333
US
I want to get the entire content of an NVARCHAR(MAX) column in a single row out into a text file for inspection. If I set query results to go to a file and write:

SELECT m.MyCol
FROM MyTable m
WHERE m.ID = 1

I get one row, but only the first 255 characters. LEN(m.MyCol) tells me it's 5997 chars long, and I can pick out 255 char substrings, but I want to inspect the whole thing.

What am I missing?

-
Richard Ray
Jackson Hole Mountain Resort
 
Sorry, make that 59,997 characters...

-
Richard Ray
Jackson Hole Mountain Resort
 
Hmmm. The biggest it will take is 8,192, and that's a long way from 60,000. Even when set that I'm still only getting 255 returned for an NVARCHAR(MAX).

SQL Server 2008R2, btw.

-
Richard Ray
Jackson Hole Mountain Resort
 
BCP worked, I was able to get the entire content out and study it to find out what I need. Onwards in XQuery land.

-
Richard Ray
Jackson Hole Mountain Resort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top