Friday, March 30, 2012

Problems with text column in SQL SERVER 2000

Hi,
I am trying to access the data inside a text column in the database and display it on a page.
The problem is, I cannot see the full data when I execute the stored procedure in SQL Server and also on the asp.net page.
it seems Sql server clips the data if it is more than 3000 characters. Is there anyway I can see the whole data that is stored in that particular column.
I do not understand why asp.net is also clipping the data. What container can I use to display the text? I have tried Literal, string, placeholder but nothing shows the full text that is supposed to be in the database.
I have seen some people using byte arrays but I am not sure how I can use them to display data on a page.
If anyone has done this before or had a similar problem please reply back.
Thanks.

Are you sure it is with the page and not the size of the parameters or the size of the field. my guess is that one of those are varchar(3000)

|||

To add to the previous post Char is fixed length, while Varchar is variable length so, I would change to Char if it is Varchar 3000. Byte arrays is for Binary data in SQL Server. Hope this helps.

|||The data type of the column is text and its length shows as 16. As far as I know, a text column can take any length of text. But I am not sure why it's not inserting the whole text and clipping it after certain characters.
I think now it's something on the database side, not on the asp.net page.
Any ideas why Sql Server is not inserting the whole data?
I tried retrieving the results to a text file and tried to see if it displays the whole text. But it shows only a small chunk of the data.
I am not sure what's wrong.|||What type of structure are retrieving the data into within your asp.net app? DataSet? Custom object? If you are using dataadapters to load your data into a dataset I would take a look at the length of the parameter representing this text field within your dataadapter commands.
Oscar|||Text datatype can grow to 2gig in size and is usually not table space based which means it is not for data stored in a column. SQL Server creates an Arithmetic pointer to the data in your file system. If you know your data from Asp.net is ASCII you can use Varchar 4000 and Char 4000, if it is Unicode you can use Nvarchar 2000 and Nchar 2000. The other option is use image which can also grow to 2gig and store the data in Word. Hope this helps.|||

I am having the same problem. It is not caused by varchar(3000) or anything else. I have change the field from text to varchar(7900) and still have the problem.
I am loading the data into a dataset variable. When you look at the dataset's tables(0).rows(0).item("field_name"), it has length 3000.
Any one else have any thoughts?

|||

orderdog,
if your loading data into a dataset where the length of the fiedl is defined as 3000, then that is all the data your going to get in or out of your dataset once loaded. Typically, if you create a dataadapter using a table from your database your text columns will be automatically converted to varchar with a size of 2million and some odd characters.
oscar

No comments:

Post a Comment