Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transforming data type in Azure Data Factory

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.

like image 663
Moon Avatar asked Oct 31 '25 05:10

Moon


1 Answers

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

like image 156
Leon Yue Avatar answered Nov 02 '25 22:11

Leon Yue



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!