Querying to construct XML in TSQL without a source table, only variables?
- by Darth Continent
Using a SELECT statement in MS SQL 2005 TSQL, and no source table, just variables as listed below...
@FirstName varchar(20)
@LastName varchar(20)
@ZipCode varchar(5)
...what syntax will build XML resembling the following?
<XMLDATA><REC FirstName="JOHN" LastName="SMITH" ZipCode="98052" /></XMLDATA>