Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 'For json' query for over 100,000 records - truncating results

Status
Not open for further replies.

bmacbmac

IS-IT--Management
Jan 26, 2006
392
US
Hello!

I have over 100,000 records in SQL that I need exported to json. My query is:

Code:
SELECT documentinfo.irecordid,
(select tempparties.* from tempparties WHERE tempparties.irecordid = documentinfo.irecordid and tipartytype = 1 FOR JSON AUTO) AS first,
(SELECT tempparties.* from tempparties WHERE tempparties.irecordid = documentinfo.irecordid and tipartytype = 2  FOR JSON AUTO) AS last,
(SELECT tempimages.* from tempimages WHERE tempimages.irecordid = documentinfo.irecordid FOR JSON AUTO) AS images,
(select templand.* from templand WHERE templand.irecordid = documentinfo.irecordid FOR JSON AUTO) AS land,
(SELECT temprelated.* from temprelated WHERE temprelated.irecordid = documentinfo.irecordid FOR JSON AUTO) AS relateds
FROM documentinfo as documentinfo
FOR JSON AUTO

I need to save results to a file for a client, but if I save results to file, the data becomes truncated pretty early on in the file. I have gone into options and set the grid and text results to the max size, but still can't get it to work.

Any advice on exporting a large number json records to a data file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top