JPJ (8/19/2008)
I agree with you wayne.I have a small issue in addition to that, this line gave me error:
select @MyXMLString = @MyXMLString +
' '+ AccountNumber +
' '
This is the error:
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near 'AccountNumber'.
Any idea?
(I do wish that this site's forum board would support the display of XML tags easier!)
For that select command, there are two extraneous quote marks. The first is on the second line, after the "Row" xml tag immediately prior to the "AccountNumber" tag. The second is on the third line, immediately after the backslash character and immediately prior to the "AccountNumber" tag.
So, it should look like:
select @MyXMLString = @MyXMLString +
'<Row><AccountNumber>'+ AccountNumber +
'</AccountNumber></Row>'
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes