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)
 Replace for text column

Author  Topic 

vk59
Starting Member

38 Posts

Posted - 2004-04-20 : 10:24:40
Hi

Is there any option to replace a single quote with 2 single quotes in the data of the text column.My text column stores more than 8000 charcters.

I would like to have something like REPLACE(TEXTCOL,'''','''''')

Thanks in advance

Vk59

`

cas_o
Posting Yak Master

154 Posts

Posted - 2004-04-20 : 10:54:19
select 'A sentence full of '' single '' quotes ' orig, replace('A sentence full of '' single '' quotes ','''','''''') replaced

;-]
Go to Top of Page

vk59
Starting Member

38 Posts

Posted - 2004-04-20 : 11:17:22
But Replace function doesnt work for text datatype columns, if data exceeds 8000 characters

`
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-04-20 : 12:28:40
BOL

quote:

Remarks
These functions and statements can be used with ntext, text, or image data.

Functions Statements
DATALENGTH READTEXT
PATINDEX SET TEXTSIZE
SUBSTRING UPDATETEXT
TEXTPTR WRITETEXT
TEXTVALID



How do you read and write to this column?



Brett

8-)
Go to Top of Page

vk59
Starting Member

38 Posts

Posted - 2004-04-21 : 01:13:13
I Use UPDATETEXT to write and READTEXT To Read

`
Go to Top of Page

cas_o
Posting Yak Master

154 Posts

Posted - 2004-04-21 : 05:15:17
Ok. Do you need to replace single quotes across rows and rows of text data? Or do you need to do it as the data comes in?

;-]
Go to Top of Page
   

- Advertisement -