<
row
>
column
>1</
</
>2</
--Sample data
DECLARE
@
Temp
TABLE
(Id1
INT
, Id2
)
INSERT
SELECT
1,1
2,2
*
FROM
--If we mention same alias name for all columns, all column values will be merged
Id1 [
],
Id2 [
]
FOR
XML PATH
/**XML result
for
above query
<row>
>11</
</row>
>22</
**/
--To overcome the above problem
-- Method 1 :
''
,
-- Method 2 :
NULL
above Method 1 & Method 2 query
Naomi N edited Revision 2. Comment: Added last line about contest
Naomi N edited Revision 1. Comment: Changed casing, added tag
Naomi N edited Original. Comment: Minor grammar corrections
Will it be Ok to add to June Guru Contributions contest?
Ya sure Naomi N ....
I did it for this article. I believe you recently contributed another article (forgot its title). You may want to do the same with it as I did with this - add to main contributions page, add link at the bottom, add more tags
Naomi - thanks for adding my XML article to the contest , anyways iam not quite sure about adding technet wiki articles to contest ,here is my another post - social.technet.microsoft.com/.../17777.t-sql-remove-leading-and-trailing-zeros.aspx ,kindly add this too if it is eligible to participate in the contest :)