July 12, 2005 at 2:43 am
Hi ,
The wrong way :
UPDATE Customer SET CustText = CustText + 'ABCD'
WHERE CustId = 10
The right way :
?
The error message :
Invalid operator for data type. Operator equals add, type equals ntext.
July 12, 2005 at 3:14 am
try this
UPDATE Customer SET CustText = cast(CustText as varchar(8000)) + 'ABCD'
WHERE CustId = 10
cheers
Rajesh
July 12, 2005 at 3:18 am
But what if CustText contains more then 8000 ?
July 12, 2005 at 3:21 am
I think there is no other way since SQL server doesn't allow to concatinate nText , image etc datatypes. Don't know if there is any other work around if it exceeds 8000 characters.
cheers
Rajesh
July 12, 2005 at 3:31 am
OK
Thanks Rajesh
July 12, 2005 at 3:34 am
try this one ...
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(CustText)
FROM customer WHERE CustId = 10
UPDATETEXT Customer.CustText @ptrval null null 'ABCD'
GO
for more info have a look at UPDATETEXT in BOL
Cheers
Rajesh
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply