I am toying around with 2 solutions to an xml report I have to generate. 1 way is via XML in SQL 2005.
I have this query below.
with xmlnamespaces ('uri' as tns)
select id as 'tns:id',
field1 as 'tns:field1',
field2 as 'tns:field2',
field3 as 'tns:field3',
field4 as 'tns:field4'
where pid = 17591
for xml path('tns:TPO'), root('tns:Claim')
The output is fine except for the very first xml element
This element should simply be
How is this done? I know its a problem for how I am using the xml namespaces, but I can't find a way to use the namespace and not have that xmlns:tns="uri" part included.