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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating TEXT data type values

Status
Not open for further replies.

JanVolleyM

Programmer
Nov 6, 2009
23
US
I'm using SQLServer 2000 and I have several tables that have fields of TEXT data type. I have a .Net application that allows a user to insert new records with new TEXT field values or update the TEXT fields in existing records. I'm using a straight sql UPDATE statement to update the TEXT value with a new value, but from what I've read, I thought you had to get a pointer to the TEXT data, and then update the value differently with the use of the pointer. My application works however, without doing that, and I'm wondering how. Do you only need the pointers if you are updating a portion of the text and don't need to use them if you are replacing the whole column?

I also thought that you needed to use a pointer in order to get the TEXT data from the db, but I'm using a straight SELECT statement and it seems to be working fine.

I've tested with data over 72K characters in length and it seems to be working without using any pointers at all.

Can someone explain this?
 
For updates I tend to use Stored Procs.

With a stored proc you can specify text as the datatype and in dotnet (sqlcommand object) classify the parameter as varchar with a size of 0

The 0 to specify unlimited bytes.

This removes the need to update the text field in chunks.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top