In my pipeline I perform an upsert from a flat CSV file (semicolon separated) into a table in our on-premise SQL-server. At first all the data types from the CSV file are read as STRING and I did the same with the SQL table, which means that I set all the fields to NVARCHAR(500). This worked fine, the upsert is based on an id field (EMPLOYEE_ID).
This CSV file is coming from another application (also MS-SQL based). So that why I changed all the NVARCHAR(500) fields to the correct ones coming from the source database.
Now I've done that I'm getting this error:
{
"errorCode": "2200",
"message": "ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed. Please search error to get more details.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=The data type text cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable.,Source=.Net SqlClient Data Provider,SqlErrorNumber=5335,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=5335,State=1,Message=The data type text cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable.,},],'",
"failureType": "UserError",
"target": "EMP upsert",
"details": []
}
I'd see that it's trying to upsert a text field to do the UNION. But I'm not using a text field to match on. Can somebody tell me what I'm doing wrong and how to solve it?
I've refreshed all the schema definitions in Azure to make sure that it sees all the datatypes correctly.