Solved

Http connector and large JSON results

  • 25 March 2022
  • 2 replies
  • 50 views

Userlevel 5
Badge +16
  • Thinkwise Local Partner Brasil
  • 390 replies

I am working on an App and I want to incorporate the economic activities.. these are available via public API. (https://servicodados.ibge.gov.br/api/v2/cnae/subclasses

How do I process this? Because I know use a NVARCHAR(MAX) variable, but I don't think it can hold the whole result?  37.8 MB ..   

However it does process but only a part of all the economic activities.  Is there a way to save the JSON as a file and later on process it? 

icon

Best answer by Mark Jongeling 25 March 2022, 23:17

View original

This topic has been closed for comments

2 replies

Userlevel 7
Badge +23

Hi Freddy,

Nvarchar(max) is able to hold 2,1GB of data so that shouldn't be the problem.

The content returned by this API is the JSON which you can capture inside a process variable with nvarchar(max). In a process procedure you can then query the data in SQL using openjson() for example.

Alternatively, you may also write that JSON to a file using the Write file connector for later processing; depends on the Use case.

Userlevel 5
Badge +16

I’ll have to troubleshoot, because I see more data in the DB but it only shows so many records and there is no cap defined in the settings.