| Author |
Topic  |
|
|
vidhyashri
Starting Member
4 Posts |
Posted - 10/12/2012 : 08:30:34
|
Hi ,
I need to convert the string value into xml value. need of query to execute it. |
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2865 Posts |
Posted - 10/12/2012 : 08:48:32
|
select convert(xml, yourstring)
Jim
Everyday I learn something that somebody else already knew |
 |
|
|
vidhyashri
Starting Member
4 Posts |
Posted - 10/12/2012 : 09:27:13
|
| string value contains xml file content. xml file content contains single quote. so i cant able to convert . |
 |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 10/12/2012 : 09:42:28
|
quote: Originally posted by vidhyashri
string value contains xml file content. xml file content contains single quote. so i cant able to convert .
Can you post sample data? Are you trying to convert a string, or import a file? If you are trying to import a file, is the data in the file plain strings, or is it xml with tags? In any case, here is an example of how you can convert even with single quotes. However, if you have special characters such as <,>, & etc., this will not work.DECLARE @x XML; SET @x = 'abcd''qure';
SELECT CAST(@x AS XML); |
 |
|
| |
Topic  |
|