2
votes

I have a "Copy" step in my Azure Data Factory pipeline which copies data from CSV file to MSSQL.

Unfortunately, all columns in CSV comes as String data type. How can I change these data types to match the data type in SQL table.

enter image description here

Here is how the data is available in CSV file.

enter image description here

I would like to change data type of WIPStateKey to Integer and ReportDt to Timestamp. I do not seem to find an option to achieve this.

1
Which column data type you want to change? Or what's destination table column type?Leon Yue
@LeonYue I updated the question with more details.Moon

1 Answers

3
votes

Yes as you said "all columns in CSV comes as String data type".

But when using a copy active, choose the csv file as the source, we can import the schema and change the column data type.

I created a demo.csv file for test:

enter image description here

I copy data from my demo.csv file to my Azure SQL database. enter image description here

During file format setting, we can change the column data type: enter image description here

Table mapping: enter image description here

Column mapping: enter image description here

Copy completed: enter image description here enter image description here

Hope this helps