Reputation: 1
I've set stage file format as JSON and trying to import below data from Azure blob, getting error. see 2nd line last SQLTableName value has double quote.
{"SQLDatabaseName":"TV","SQLSchemaName":"sec","SQLTableName":"UserProfile"} {"SQLDatabaseName":"LW","SQLSchemaName":"sec","SQLTableName":"User"Profile"}
in sql server i am exporting each row in json above format to move data into snowflake.
Upvotes: 0
Views: 369
Reputation: 2049
Your data in JSON format is incorrect, the second line is not JSON validated. Check your sample data on this page: JSON Formatter & Validator
You should use some escape character when exporting.
It does not validate:
SELECT PARSE_JSON('{"SQLDatabaseName":"LW","SQLSchemaName":"sec","SQLTableName":"User"Profile"}');
If you change your data and add an escape character, it will validate:
SELECT PARSE_JSON('{"SQLDatabaseName":"LW","SQLSchemaName":"sec","SQLTableName":"User\'Profile"}');
SELECT PARSE_JSON('{"SQLDatabaseName":"LW","SQLSchemaName":"sec","SQLTableName":"User\\"Profile"}');
Upvotes: 2