skip to Main Content

I copy data from postgre db to azure sql with copy activity and auto-create table feature enabled.

there is a column with type timestamptz in Source db. looks like
2023-07-03T07:00:47.707369+00:00
2023-07-03T07:00:52.375166+00:00

when I auto-create table in Azure SQL it always creates datetime2(0) and looks like
2023-07-03T07:00:47
2023-07-03T07:00:52

I want to create azure sql datetimoffset column. I tried mapping but not succesfully
If I do copy in existing table with datetimoffset colum – everything works correct, the problem only appears when table is created by adf engine

2

Answers


  1. Chosen as BEST ANSWER

    yes, finally, I can confirm DataFlow transroms data type more correct - in my case to datatime2(7). It's still not an ideal but an appropriate solution


  2. I don’t think you can control how ADF decides data types.

    You can add a script to drop and recreate the table to the pre-copy script, with the exact datatypes you need.

    If you need it to be dynamic (the columns on the source change frequently), you can use Postgresql system catalogs to get the columns and datatypes of your source table and build the create table command accordingly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search