SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


UPDATETEXT or WRITETEXT?


UPDATETEXT or WRITETEXT?

Author
Message
Tom Carnahan
Tom Carnahan
SSC-Addicted
SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)

Group: General Forum Members
Points: 400 Visits: 1489
Hello,

I searched the prior posts and scrutinized the BOL ... I still have some confusion.

I am stuck with a database application that uses SS2k (no way of upgrading). A table the application uses has a field that is NVARCHAR(4000) ... stores non-Latin character sets ... that needs to be changed to NTEXT in order to store more character data. I understand my choices are UPDATETEXT and WRITETEXT.

Q1: If I am completely replacing the contents of one field in one row, do I use UPDATETEXT or WRITETEXT?

Q2: I am not having much luck getting UPDATETEXT to completely remove the old text and replace it with the new. Could someone show me the correct way to "replace all existing" text in the one field in the one row?

Thanks ahead of time for any help you can provide!
Sergiy
Sergiy
SSC-Dedicated
SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)SSC-Dedicated (31K reputation)

Group: General Forum Members
Points: 31422 Visits: 12555
Did you try simple UPDATE?
Tom Carnahan
Tom Carnahan
SSC-Addicted
SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)

Group: General Forum Members
Points: 400 Visits: 1489
BOL recommends that you don't use UPDATE with NTEXT since the field only holds a pointer to "out of row" data.
Tom Carnahan
Tom Carnahan
SSC-Addicted
SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)SSC-Addicted (400 reputation)

Group: General Forum Members
Points: 400 Visits: 1489
NTEXT can hold up to 2 Billion characters. The max number of bytes for a row in SS2K is 8060. SS2K stores the data in other places and only keeps a pointer in the field.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search