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 2005 Forums
 Transact-SQL (2005)
 Double apostrophes in data

Author  Topic 

valedaw2
Yak Posting Veteran

50 Posts

Posted - 2009-06-30 : 09:13:01
Hello,
I have a file with double apostrophes in the data. For example - Ronald"s. How can I replace these with single quotes in SQL 2005?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-30 : 09:14:15
[code]replace(col, '"', '''')[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

valedaw2
Yak Posting Veteran

50 Posts

Posted - 2009-06-30 : 09:21:31
I checked the data and it is actually 2 single quotes - PATRICK O''CONNOR
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-30 : 09:25:32
oh sorry

replace(col, '''''', '''')



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

valedaw2
Yak Posting Veteran

50 Posts

Posted - 2009-06-30 : 09:26:50
I did get it to work with
replace(clean_name1, '''''', '''')

Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-30 : 09:45:40
Refer this to know how single quotes work
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx

Madhivanan

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

- Advertisement -