我在 SQL Server 2005 中使用以下脚本来创建 xml 输出
select
mst.Reference "Reference",
convert(varchar(10), mst.CreatedOn, 121) "Date_Created",
convert(varchar(10), mst.DueOn, 121) "Date_Due",
isnull(mst.Amount1, 0.00) "Amt_1",
isnull(mst.Tax1, 0.00) "Tax_1",
isnull(mst.Item_Count, 0.00) "No_Of_Items",
isnull(mst.Amount2, 0.00) "Amt_2",
isnull(mst.Tax2, 0.00) "Tax_2",
isnull(mst.Total, 0.00) "Total",
isnull(mst.Note, '') "Notes",
(select
det.Reference "Reference",
det.Itm_Num "Order",
isnull(det.Description, '') "Description",
det.Code "Code",
isnull(det.Amount1, 0.00) "Amt_1",
isnull(det.Tax1, 0.00) "Tax_1",
isnull(det.Amount2, 0.00) "Amt_2",
isnull(det.Tax2, 0.00) "Tax_2",
isnull(det.Note, '') "Notes"
from tblDetail det
where det.Mst_Reference = mst.Reference
order by det.Itm_num
for xml path ('item'), type)
from tblMaster mst
for xml path ('master'), root('root'), type
然而,这给我返回了一个没有任何错误的空白 xml,但是如果我将它更改为只从它创建并返回 xml 的主服务器获取 4 条记录。xml 创建的记录数是否有限制?
谢谢