0

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...

4

1 回答 1

2

当发送到网格时,您可能会看到 SSMS 默认为非 XML 数据类型的 256 个字符和 XML 的 1MB 的截断。

您可以通过单击工具、选项、查询结果、SQL Server、结果到网格、XML 数据 = 无限制来修改此设置

于 2015-02-24T20:30:03.963 回答