如何在不使用 OPENJSON 的情况下获取 json 对象 属性
How to get json object property without using OPENJSON
以下是我从中获取特定值(OldPTValue、NewPTValue)的脚本
table HistoryTracking
.
我正在使用 OPENJSON
但出现兼容性问题。
在 sql 服务器 2016 中有没有不使用 OPENJSON
获取数据的方法?
SELECT
(
SELECT [Number]
FROM OPENJSON( CHT.OldValues, '$.Employee' )
WITH ([Number] NVARCHAR(25) '$.PaymentTerms')) AS OldPTValue,
(
SELECT [Number]
FROM OPENJSON( CHT.NewValues, '$.Employee' )
WITH ([Number] NVARCHAR(25) '$.PaymentTerms')
) AS NewPTValue,
CHT.InsertedBy,
CHT.InsertedDate
FROM HistoryTracking CHT
ORDER BY CHT.Employee, CHT.InsertedDate desc
以下是我从中获取特定值(OldPTValue、NewPTValue)的脚本
table HistoryTracking
.
我正在使用 OPENJSON
但出现兼容性问题。
在 sql 服务器 2016 中有没有不使用 OPENJSON
获取数据的方法?
SELECT
(
SELECT [Number]
FROM OPENJSON( CHT.OldValues, '$.Employee' )
WITH ([Number] NVARCHAR(25) '$.PaymentTerms')) AS OldPTValue,
(
SELECT [Number]
FROM OPENJSON( CHT.NewValues, '$.Employee' )
WITH ([Number] NVARCHAR(25) '$.PaymentTerms')
) AS NewPTValue,
CHT.InsertedBy,
CHT.InsertedDate
FROM HistoryTracking CHT
ORDER BY CHT.Employee, CHT.InsertedDate desc