Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

UPDATETEXT or WRITETEXT? Expand / Collapse
Author
Message
Posted Friday, January 22, 2010 2:16 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, April 07, 2014 9:19 AM
Points: 69, Visits: 1,456
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!

Post #852346
Posted Friday, January 22, 2010 2:18 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Sunday, April 13, 2014 9:51 PM
Points: 4,570, Visits: 8,315
Did you try simple UPDATE?
Post #852347
Posted Friday, January 22, 2010 5:15 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, April 07, 2014 9:19 AM
Points: 69, Visits: 1,456
BOL recommends that you don't use UPDATE with NTEXT since the field only holds a pointer to "out of row" data.
Post #852420
Posted Friday, January 22, 2010 5:17 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, April 07, 2014 9:19 AM
Points: 69, Visits: 1,456
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.
Post #852422
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse