cfquery truncates at 32000 chars
Just had an "interesting" problem with a CMS system. A client had entered a huge chunk of text which had saved in the MS SQL ntext field correctly, however when it was pulled out of the database (using cfquery) and displayed on the website, the text was being truncated. After some detective work I discovered that the text that was being shown on the webpage was exactly 32,000 characters long. I figured that was too much of a coincidence so a quick google search later I had my answer thanks to Joe Rinehart.
The solution is simple, in your CFIDE, find the offending datasource and in the "advanced settings" section, you'll see that you have a "Blob Buffer(bytes)" (as ntext is a blob). Just increase this value and the problem is solved.
Of course a better solution would be to suggest that the client might want to consider editing their text!
- Posted in:
- ColdFusion


Comment by Ben Nadel – March 09, 2009
Comment by John Whish – March 09, 2009
SQL 2005 has deprecated the NTEXT in favor of NVARCHAR(MAX).
Comment by Henry Ho – March 09, 2009
I believe this is truncation is a function of the database driver, not the database itself. I don't think it should be affected by the NVarChar.
Comment by Ben Nadel – March 09, 2009
Comment by John Whish – March 10, 2009
Comment by Sebastiaan – March 10, 2009
Comment by Ryan Knutson – April 30, 2009
Comment by Simon Harper – October 13, 2009
Comment by EB – April 21, 2011
i just checked " -- Enable binary large object retrieval (BLOB)." and now its working
Comment by prashant – September 22, 2011