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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JE_test
Resolver I
Resolver I

"column does not allow nulls. INSERT fails, but column allows NULL". But column allows nulls...

Hi!

I'm currently working in a Data Warehouse.

 

Error:

ERROR: Cannot insert the value NULL into column ''OnskarAttDeltaIAntalSammankomster'', table ''Lagengagemang_VIEW''; column does not allow nulls. INSERT fails.

Table column:

JE_test_0-1713528003804.png

 

The code I'm running looks something like this: 

INSERT [',@TargetSchema,'].[',@TableName,'] (',@Columns,')
SELECT ',@Columns,'
FROM [',@SourceSchema,'].[v',@TableName,']');

basically inserting data from a view into a table.

 

As you can see from my screen-shot the column that is giving the error allows NULLs.

I've tried to re-create the table multiple times and re-run the insert with no success.

 

I recently added 4 new column to the table and the view by deleting it and creating it again. Not sure if that has anything to do with anything...

 

Any ideas what is going on and how to fix it?

Feels like a problem that might go away by just waiting a few days...

 

br

 

1 ACCEPTED SOLUTION
JE_test
Resolver I
Resolver I

I had created my view or table wrongly, not it works 🙂 

View solution in original post

2 REPLIES 2
JE_test
Resolver I
Resolver I

I had created my view or table wrongly, not it works 🙂 

Hi @JE_test 

 

Glad that you query got resolved.
Please continue using Fabric Community for further queries.

 

Thanks.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

November Update

Fabric Monthly Update - November 2024

Check out the November 2024 Fabric update to learn about new features.

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! Early Bird pricing ends December 9th.