JSON文字列からデータを抽出し、SQL Serverテーブルに挿入しようとしました。しかし、私はこのエラーを取得する:ここで jsonからデータを抽出してSQL Serverに挿入する
は私のコードですIncorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
declare @json nvarchar(max) = '{
"id" : 2,
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 25,
"dateOfBirth": "2015-03-25T12:00:00"
}'
SELECT *
FROM OPENJSON(@json)
WITH (id int, firstName nvarchar(50), lastName nvarchar(50),
age int, dateOfBirth datetime2)
行セットに変態
OPENJSON
機能in SQLクエリ –サーバーがSQL Server 2を実行していることを確認する016.古いバージョンは 'OPENJSON'をサポートしていません。 –