ODBC guide

Create document from file path


Inserts a document whose JSON body is read from a local file. The file path must start with the @ symbol (e.g. @c:\data\order.json). Set IsMultiPart=1 in WITH so the driver reads from disk. Partition key rules are the same as for inline document insert.

INSERT INTO TestContainer (PartitionKey, Document)
VALUES(
'["user2"]', --partition key value must match its attribute from document else it will throw error. In this example container PartitionKey is /id so we used its value. For multiple key use JSON array ["val1","val2"]
'@c:\data\order.json'   --path must start with @ symbol
)
WITH(Upsert='true', IsMultiPart=1)