Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL:UpdateText function :How to use?

Tags:

sql

can anyone show me an example of using SQL server UPDATETEXT funciton.I want to apply some text replacement from one column(which is of type text) from one of my table

like image 913
Shyju Avatar asked Mar 20 '26 17:03

Shyju


1 Answers

From Books Online:

USE pubs;
GO
ALTER DATABASE pubs SET RECOVERY SIMPLE;
GO
DECLARE @ptrval binary(16);
SELECT @ptrval = TEXTPTR(pr_info) 
   FROM pub_info pr, publishers p
      WHERE p.pub_id = pr.pub_id 
      AND p.pub_name = 'New Moon Books'
UPDATETEXT pub_info.pr_info @ptrval 88 1 'b';
GO
ALTER DATABASE pubs SET RECOVERY FULL;
GO

More info here.

like image 88
D'Arcy Rittich Avatar answered Mar 22 '26 10:03

D'Arcy Rittich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!