Unanswered: problem accessing a column of type ntext
I am working on an application which accesses SQL database. I have a table complaint in which i have a coulmn 'history' of type "ntext". When i insert a value, the value gets stored in the db correctly, but I cannot access the complete data from that field using a simple select query. I had to export the table to a text file only then i could view the complete data of the field.
I wrote the query in query analyzer as:
"select history from complaint where pkey=142"
& the result i got is:
###### admin: Jan 8, 2007 3:53:57 PM GMT Type: Inactive (Key 10) Description: Activity yet to be started State: Planned "
This is only a part of the entire string that I had entered.
My requirement is that I need to access the data from the ntext field & save it in a variable & then display the entire data in my application. Can anyone tell me how should i use the select query so that i get the entire data without having to go thru the export data procedure.
You are probably using Query Analyzer or one of its counterparts. They artificially limit the amount of text returned on a per-column basis in order to improve performance and allow the code to work with result sets of arbitrary size. You can alter the portion of the column that is returned to the client, but where and how you set that varies from tool to tool.
You should not have any problem in your application code, but if you do the solution is simply to alter a setting in your data library, I've never needed to change code to support text or ntext.