Tuesday, 20 August 2013

sql 2005 for xml limitation

sql 2005 for xml limitation

I am using the following script in SQL 2005 to create a xml output
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
This is however returning me a blank xml without any errors but if i
change it to just fetch 4 records from the master it creates and returns
the xml. IS there a limit on the no of records on xml creation.
thanks

No comments:

Post a Comment