Home Forums SQL Server 2008 T-SQL (SS2K8) Problem using FOR XML in SQL Query RE: Problem using FOR XML in SQL Query
Matthew Darwin
SSCertifiable
Points: 5513
More actions
July 3, 2013 at 3:40 am
#1629442
Try this:-
SELECT
(SELECT custname AS CustName
, custcode AS CustCode
FROM @test-2 t1 FOR XML PATH('Item'), TYPE)
FOR XML PATH('Header'),ROOT('ns1')
Follow me on twitter @EvoDBACheck out my blog Natural Selection DBA[/url]