Datetime issue in Azure Data Factory

Moulshree Dhanawade 1 Reputation point
2020-11-17T09:07:29.097+00:00

There is datetime conversion issue while loading data incrementally from SQL Server to Azure SQL server using timestamp. The datetime should be converted to datetime2 at source side. Please suggest any work around to this issue?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,696 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    2020-11-30T22:12:43.37+00:00

    Hello @Moulshree Dhanawade ,

    My apoligises for the delay in response on my side .

    I created a dummy table with a datetime2 column and on the sink side I created a table withj datetime column . I am sharing the script and I was able to copy the records without any issue . You will have to make sure that the mapping is set right .

    create table tabledatetime2_issue   
    (   
    _somedatetime2 datetime2   
    ,name varchar(100)   
    )   
      
    create table tabledatetime2_issue_Sink  
    (   
    _somedatetime datetime   
    ,name varchar(100)   
    )   
      
    insert into tabledatetime2_issue values (getdate(),'John')  
    insert into tabledatetime2_issue values (getdate(),'Robert')  
      
    select * from tabledatetime2_issue  
    select * from tabledatetime2_issue_Sink  
    

    43893-datatime2.gif

    Thank you
    Thanks Himanshu
    Please do consider to click on "Accept Answer" and "Upvote" on the post that helps you, as it can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.