0
votes

I am trying to load data from a csv to a SQL server database using an Azure pipeline copy data operator.It throws following error during trigger the pipeline. In CSV file i have one date column (StatusDate) with null values when i am importing data in MS-SQL Data base table is having StatusDate is a date time column.

Error msg[![Source CSV File][1][1]: "Operation on target Copy data1 failed: Failure happened on 'Source' side. 'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed. Please search error to get more details.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=Microsoft.Azure.Data.Governance.Plugins.Core.TypeConversionException,Message=exception occurred when converting data from column name 'StatusDate', type 'String', value 'null' to type 'DateTime': The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.FormatException,Message=The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.,Source=mscorlib,'"

Destination Table Structure:

create table RepsNoLongerInDiscovery(
[CRD]   [varchar](11)   ,
[First] [varchar](50)   ,
[Middle]    [varchar](50)   ,
[Last]  [varchar](50)   ,
[Suffix]    [varchar](50)   ,
[Status]    [varchar](20)   ,
[StatusDate]    [datetime]  ) 
1

1 Answers

0
votes

I tested with copy active and it works well.

My dataset:

enter image description here

Bellow is my Source:

enter image description here

Note: we must specify the column data type as DateTime in Mapping settings: enter image description here

Then run the pipeline and check the data in Sink table: enter image description here

Hope this helps.