Solved

ntext only returns 255 characters

Posted on 2004-10-19
14
506 Views
Last Modified: 2012-08-13
I have a table with both varchar and ntext fields types.  I recently converted a varchar(300) field to ntext.  I can store 1000+ chars in this field and see all of them when browsing using something like an Access ADP file but a select statement or crystal report will only return the first 255 chars.  Other ntext fields in the same table return more than 255 chars.  Why can't I retrieve all of the ntext field in Query Analyzer or Crystal?
0
Comment
Question by:mdebeer
  • 6
  • 4
  • 2
14 Comments
 

Author Comment

by:mdebeer
ID: 12355130
P.S. "select @@textsize" shows a value of 64512
0
 

Author Comment

by:mdebeer
ID: 12355136
It gets stranger... a select on two ntext fields in Query Analyzer only show 255 chars.   But for the same two fields in Crystal Reports, the first (originally varchar(300) and converted to ntext) shows 255, the second (orginally defined as ntext) shows the whole field.
0
 
LVL 34

Expert Comment

by:arbert
ID: 12355155
In query analyzer, if you go to Tools, Options, Results tab, what is the setting for the "maximum characters per column".

Ho did you conver the varchar columns to Ntext?  Enterprise Manager?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:mdebeer
ID: 12355170
Ah ha!  Progress.  In Query Analyzer it was set to 256.  I changed it to 3000 and got all the characters.  But do you know why it doesn't show them all in Crystal Reports?  It does show more than 255 for other ntext fields in the same table.  And yes, I changed it in Enterprise Manager.
0
 
LVL 34

Expert Comment

by:arbert
ID: 12355214
What version of Crystal?  The earlier versions didn't have the greatest support for Text types....
0
 

Author Comment

by:mdebeer
ID: 12355221
version 9 or 9.2.3.970 to be exact.  Thing I don't get is why it displays some ntext fields entirely but not this one.  I have the "Can Grow" attribute set as well.
0
 
LVL 34

Expert Comment

by:arbert
ID: 12355251
Hmm, did you "refresh" the structure after you converted the column from Varchar to Ntext?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12358242
AFter you changed the database did you do a VERIFY DATABASE in Crystal

Open the report
Click DATABASE --> VERIFY DATABASE
you may get a window to remap the fields.  If the appropriate fields don't show then ensure all fields are displayed. There is a check box for show all fields or shows matching fields. I on't have CR here to verify which t is.  It needs to be reversed.

mlmcc
0
 

Author Comment

by:mdebeer
ID: 12358457
Yes, I tried that too and it did not prompt me to remap fields, just said the database was up to date.
0
 
LVL 34

Expert Comment

by:arbert
ID: 12358728
Ok, so if you build a new report, does it work correctly?  I've had problems in the past where Crystal is just difficult to force a structure refresh.  Sometimes just by using "Set Location" it will force it as well.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 12364052
You may have to delete the field from the report then readd it.  If that doesn't work try deleting the field, verify the database, then readd the field.

mlmcc
0
 

Author Comment

by:mdebeer
ID: 12364728
I tried changing the location to a view of the same name in a different database and that and it didn't work; also tried to delete field and readd it.  I finally solved it but I had to remove the field from my view, then verify the database, then re-add it to the view, then reverify the database and that did the trick.  Thanks for your suggestions.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LTrim & Double Space Correction 5 42
SQL Query 2 34
Need return values from a stored procedure 8 23
Finding gaps or missing dates in a date range using TSQL 3 28
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question