Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Anonymous
Not applicable

Error with DATETIME2 in Copy Activity (CSV to SQL Data Warehouse)

Hey everyone,

I'm running into an issue in Microsoft Fabric's Copy Activity while trying to copy a CSV file into my SQL Data Warehouse. I'm adding a new column with a datetime2 value before the copy operation, but it's throwing an error during the process.

I’ve added the following dynamic content to create the datetime2 column in the Additional Columns section:

u/formatDateTime(convertFromUtc(utcNow(), 'W. Europe Standard Time'), 'yyyy-MM-ddTHH:mm:ss.fffffff')

But when the data is copied, I get this error:

ErrorCode=DWCopyCommandOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message='DataWarehouse' Copy Command operation failed with error ''Column '_DTS' of type 'DATETIME2' is not compatible with external data type 'Parquet physical type: BYTE_ARRAY, logical type: UTF8', please try with 'VARCHAR(8000)'. 

It seems like the datetime2 column in my SQL Data Warehouse isn't compatible with the external data from the CSV file, which is being interpreted as a VARCHAR.

I would rather not change the column to VARCHAR(8000) I have tried using the correct datetime2 format in the dynamic content.

Has anyone faced a similar issue when copying a CSV file into a SQL Data Warehouse using Microsoft Fabric's Copy Activity? Or found a way to properly insert datetime2 values? I’d appreciate any advice or workarounds!

Thanks for your help!

 

Update: I think is because of the Staging area in the workspace. It might convert the data to a certain data type which the warehouse cant accept in the dateetime2 column, but im not sure?

Does anyone know how I can solve this?

2 REPLIES 2
R1k91
Super User
Super User

according to documentation datetime2 in warehouses supports up to 6 digits fraction of seconds.

looking to your code you're using 7 digits.

 

Data types - Microsoft Fabric | Microsoft Learn


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I unfortunately get the same error after changing the digits

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.