Last post Jan 29, 2020 02:56 AM by Yang Shen
Jan 28, 2020 10:45 AM|SinjuRenny|LINK
I have a procedure which call another procedure in it and return a json result by the inner procedure in sql server.How I can retrieve the json result(from inner procedure) and store it in a temporary table.Please help me.I do in this way,but got an error
"The FOR JSON clause is not allowed in a INSERT statement."
DECLARE @EquipmentId NUMERIC(18,0)
DECLARE @EquipmentDetails table
SELECT @EquipmentId=Equipment_ID FROM Prime.Requisition WHERE ID=1
INSERT INTO @EquipmentDetails
EXECUTE [Prime].[Get_ReqSpares_EquipmentDetails] @EquipmentId
Jan 29, 2020 02:56 AM|Yang Shen|LINK
A solution for your current situation can not be provided since the information is not enough.
But you can check
this similar case, use CTE seems can solve the problem and you can have a try.