0
votes

I have a source data in csv. I created a sql table to insert the csv data. My sql table has primary key column & foreign key column in it. I cannot skip these 2 columns while mapping in Data factory. How to overcome this & insert data ?

1
Well, obviously you cannot insert data without those columns so what would you expect? Can you add the values in the csv file? What is the layout of the csv and the schema of the table?Peter Bons
Consider use stored procedure to generate values for that two columns?Fang Liu

1 Answers

0
votes

Please refer to the rules in the Schema mapping in copy activity.

  • Source data store query result does not have a column name that is specified in the input dataset "structure" section.
  • Sink data store (if with pre-defined schema) does not have a column name that is specified in the output dataset "structure" section. Either fewer columns or more columns in the "structure" of sink dataset than specified in the mapping.

  • Duplicate mapping.

So,if your csv file does not cover all the columns in the sql database,copy activity can't work.

You could consider creating temporary table in sql database to match your csv file ,then use stored procedure to fill the exact table. Please refer to the detailed steps in this case to implement your requirement:Azure Data Factory mapping 2 columns in one column