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 '' with '

Author  Topic 

davidagnew
Starting Member

2 Posts

Posted - 2005-07-21 : 04:12:05
Hi,

When cleaning data, I need to be able to replace O''reily with O'reily for example.

i.e.
SELECT REPLACE(O''reily,'', ')
or
SELECT REPLACE(name,'', ')

but his brings up syntax errors because single ' is used.

Any help much appreciated. Thanks.

David

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-21 : 04:22:52
[code]Declare @name varchar(20)
set @name='O''''reily'
Select @name
SELECT REPLACE(@name,'''''', '''')[/code]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

davidagnew
Starting Member

2 Posts

Posted - 2005-07-21 : 04:41:00
thanks
Go to Top of Page
   

- Advertisement -