Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Ref:Ntext datatype

Author  Topic 

Prashant
Starting Member

2 Posts

Posted - 2004-08-12 : 05:57:20
Hi
I have a stored procedure with a parameter of type ntext. I am trying to use replace function on this parameter to replace few characters, but replace function doesn't work with ntext data types.Please suggest me an alternative for replacing characters of ntext datatype from a stored procedure point of view.

Thanks
Prashant

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-08-12 : 06:07:32
You can use WRITETEXT or UPDATETEXT.

Look them up in books online.


Duane.
Go to Top of Page

Prashant
Starting Member

2 Posts

Posted - 2004-08-12 : 06:24:19
If you could help me in using that it would be great.

Thanks
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-08-12 : 06:27:29
quote:
From Books OnLine
Examples
This example puts the text pointer into the local variable @ptrval, and then WRITETEXT places the new text string into the row pointed to by @ptrval.
[CODE]
USE pubs
GO
EXEC sp_dboption 'pubs', 'select into/bulkcopy', 'true'
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'
WRITETEXT pub_info.pr_info @ptrval 'New Moon Books (NMB) has just released another top ten publication. With the latest publication this makes NMB the hottest new publisher of the year!'
GO
EXEC sp_dboption 'pubs', 'select into/bulkcopy', 'false'
GO
[/CODE]



Duane.
Go to Top of Page
   

- Advertisement -