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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Soobramoney
Frequent Visitor

Lakehouse table datatypes

Hi,

 

I have a Fabric Lakehouse table that contains all string data types. I need to load the data into a new table with the correct data types. When I use the copy data activity, I receive an error message stating that null values in string columns cannot be inserted into an int column. How can I update these columns with actual null values, or is there an easier way to load the data with the correct data types?

 

Thanks

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Hi @Soobramoney ,

 

For this type of problem, you can make sure that the columns are defined with the correct data types when you create a new table, and allow null values if necessary.

The following demonstrates the successful insertion of a NULL value in a table:

CREATE TABLE [NullCheck1]
(
    col1 int not null,
    col2 VARCHAR(30) NULL,
    col3 VARCHAR(30) not NULL,
    col4 int NULL
)
GO


INSERT INTO [NullCheck1] VALUES (3,NULL,'NA',NULL)


select * from  [dbo].[NullCheck1]

vkongfanfmsft_0-1725331697443.png

vkongfanfmsft_1-1725331713970.png

vkongfanfmsft_3-1725331985808.png

 

vkongfanfmsft_2-1725331809500.png

Best Regards,
Adamk Kong

 

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

 

View solution in original post

1 REPLY 1
v-kongfanf-msft
Community Support
Community Support

Hi @Soobramoney ,

 

For this type of problem, you can make sure that the columns are defined with the correct data types when you create a new table, and allow null values if necessary.

The following demonstrates the successful insertion of a NULL value in a table:

CREATE TABLE [NullCheck1]
(
    col1 int not null,
    col2 VARCHAR(30) NULL,
    col3 VARCHAR(30) not NULL,
    col4 int NULL
)
GO


INSERT INTO [NullCheck1] VALUES (3,NULL,'NA',NULL)


select * from  [dbo].[NullCheck1]

vkongfanfmsft_0-1725331697443.png

vkongfanfmsft_1-1725331713970.png

vkongfanfmsft_3-1725331985808.png

 

vkongfanfmsft_2-1725331809500.png

Best Regards,
Adamk Kong

 

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.