I've got a simple (?) problem.
I have a table t_dane_nieruch
with one column nr_ewid
(int, not null
)
My query looks like this:
select top 40
nr_ewid
from
t_dane_nieruch
for xml auto, elements
It produces this output:
<t_dane_nieruch>
<nr_ewid>3</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>4</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>7</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>8</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>11</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>49</nr_ewid>
</t_dane_nieruch>
<t_dane_nieruch>
<nr_ewid>51</nr_ewid>
</t_dane_nieruch>
Problems:
- Output is not a valid XML
- Numbers of output elements is too few
Using SSMS with SQL Server 2008 R2 Express - output to text or file produce the same...