Author Topic: Microsoft Sql 2016 For Json  (Read 1761 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 147
    • View Profile
Microsoft Sql 2016 For Json
« on: April 10, 2019, 08:42:35 pm »
Hello,

"Param Grid" I want to get the data directly from "mssql".

I tried to create a Procedure, but I was not successful.

Do you have any advice?

Thanks.


Note: Data from 2 seconds in sql is converted to json in 54 seconds by classic asp. (Sample 5000 rows)

Code: [Select]
declare @data nvarchar(max)=null
declare @totalRecords int=0
declare @curPage int=1

SET @data=(
SELECT TOP 10
i.InventoryCode
  , i.InventoryName
FROM Erp_Inventory i WITH (NOLOCK)
for JSON AUTO
--FOR JSON PATH, ROOT ('data')
)

set @totalRecords=@@rowcount

select
@totalRecords as 'totalRecords'
,@curPage as 'curPage'
,@data as 'data'
for JSON PATH