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 |
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2011-12-03 : 00:20:24
|
| Hi All,I want to generate the xml using xmlpath as below:<s t='3' a='3'><c k='RelayServer'>apsqa01</c></s>I have written like this select '3' AS 's/@t', '3' AS 's/@a', 'RelayServer' AS 's/c/@k', 'apsqa01' AS 'c' FOR XML PATH('')but iam getting output like below :<s> <s t="3" a="3"> <c k="RelayServer" /> </s> <c>apsqa01</c></s>kindly help me on the samerams |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 00:27:59
|
it should be as belowselect '3' AS 's/@t','3' AS 's/@a','RelayServer' AS 's/c/@k','apsqa01' AS 's/c'FOR XML PATH('')------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2011-12-03 : 00:32:36
|
| thanks visakh, it worked :)rams |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 01:42:28
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|