I am getting this error while trying to write the metadata output from DataFactory to a SQL Server database.
"errorCode": "2402",
"message": "Execution failed against SQL Server.
SQL error number: 13609.
Error Message: JSON text is not properly formatted. Unexpected character 'S' is found at position 0."
I am using a stored procedure in the SQL Server database.
Metadata output:
{
"childItems": [
{
"name": "DemoFile1",
"type": "File"
},
{
"name": "DemoFile2",
"type": "File"
} ]
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime",
"executionDuration": 0
}
Procedure code:
CREATE PROCEDURE prod1
@parameter1 NVARCHAR(max)
AS
BEGIN
INSERT INTO [dbo].[Table1] ([name], [type])
SELECT
name, type
FROM
OPENJSON(@parameter1)
WITH (
name NVARCHAR(max) '$.name',
type NVARCHAR(max) '$.type'
) AS jsonValues
END
TIA!