An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
Hello @John Edwards
That follow-up changes the diagnosis. If removing Agent_Name simply causes the next mapped field to fail with the same 2200 / DataTypeNotSupported error, I wouldn't keep changing the Azure SQL column types. The problem is probably occurring before the data reaches SQL.
Since your source is a REST API returning JSON, Synapse Copy Activity treats it as a hierarchical source. Microsoft documents that REST JSON needs hierarchical-to-tabular schema mapping when writing into a relational sink such as Azure SQL.
The fact that the response copies successfully to a temporary file also doesn't prove that it has been converted into tabular scalar values. The REST connector can copy a JSON response as-is to a file without schema mapping.
I'd inspect the raw API response next. In particular, determine whether it looks like:
{
"value": [
{
"Agent_Name": "John",
"Field2": "abc",
"Field3": "xyz"
}
]
}
If your records are inside an array such as value, configure that array as the collection reference and map the individual properties from each array element to the SQL columns. Microsoft specifically documents collectionReference for converting objects within a JSON array into individual tabular rows.
For example, the mapping concept would be:
Collection reference: $['value']
['Agent_Name'] -> Agent_Name
['Field2'] -> Field2
['Field3'] -> Field3
Don't specify text, varchar, etc. as source types just to make the mapping work. Those SQL data types won't solve the problem if Synapse still sees the source value as a JSON object/array rather than a scalar string.
I'd therefore ask you to post a sanitized sample of the actual JSON response, particularly the root object and first record, along with the current Copy Activity Mapping configuration. That should tell us whether the missing/incorrect collectionReference or JSON paths are the real issue.
If the JSON contains more complex nested arrays/objects that can't be flattened cleanly with Copy Activity, Microsoft recommends Mapping Data Flow for more advanced hierarchical-to-tabular transformations.
Sharing you these references:
Microsoft Learn – Schema and data type mapping in Copy Activity | https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-schema-and-type-mapping?
Microsoft Learn – REST connector for Azure Data Factory and Synapse | https://learn.microsoft.com/en-us/azure/data-factory/connector-rest?
Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.