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.
| Author |
Topic |
|
jimmy.hunt
Starting Member
21 Posts |
Posted - 2006-04-08 : 11:20:28
|
| For some reason when I try to do this it isn't working. Any clues?SELECT REPLACE(ArticleXML, '<section id='0'>', '') as testfrom kbtableI thought the &apos would work, but it isn't. How can I get rid of these section tags that have single quotes in them?Thanks!JamesJames Hunt |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-04-08 : 11:30:09
|
SELECT REPLACE(ArticleXML, '<section id=''0''>', '') as testfrom kbtablereplace one ' with two 'Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
jimmy.hunt
Starting Member
21 Posts |
Posted - 2006-04-08 : 12:32:32
|
| How would I right the select statement to do this. Because neither of these work:SELECT REPLACE(ArticleXML, '<section id='0'>', '<section id=''0''>') as testThis one gives an error:SELECT REPLACE(ArticleXML, ''', '''') as testJames Hunt |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-04-08 : 12:45:50
|
from where do you get ' ??Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2006-04-08 : 13:38:40
|
Jimmy,Spirit1 already gave you the answer. You need TWO singlequote characters on each side of the zero.SELECT REPLACE(ArticleXML, '<section id=''0''>', '<section id="0">') as test Note that the first section id has two SINGLE quotes aroundthe zero, whereas the second has a single DOUBLE quote oneither side of the zero. |
 |
|
|
jimmy.hunt
Starting Member
21 Posts |
Posted - 2006-04-08 : 17:02:51
|
| OK. Great! Now I understand. Thanks!James Hunt |
 |
|
|
|
|
|
|
|