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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Hennie1234
Frequent Visitor

INSERT fails with a subset of columns when columns are NULL

Hi,

 

I think it is a bug when I try to insert data with INSERT statement in a table in Synapse data warehouse

 

 

insert titles (title_id, title, type, pub_id, notes) values('PC9999', 'Net Etiquette',
'popular_comp', '1389', 'A must-read for computer conferencing.')
GO

This will give an error

 

Msg 15806, Level 0, State 1
Cannot insert the value NULL into column 'ytd_sales', table 'titles'; column does not allow nulls. INSERT fails.

 

 

DROP TABLE IF EXISTS titles;

CREATE TABLE titles
(
title_id varchar(80),
title varchar(80) NOT NULL,
type char(12) NOT NULL,
pub_id char(4) NULL,
price DECIMAL(7,2) NULL,
advance DECIMAL(7,2) NULL,
royalty int NULL,
ytd_sales int NULL,
notes varchar(200) NULL,
pubdate datetime2(0) NOT NULL
);

1 REPLY 1
HimanshuS-msft
Microsoft Employee
Microsoft Employee

Hello  @Hennie1234 

Thanks for using the Fabric community .

I think I have a repro and I think the error message with to be corrected . 

The correct message should be
Error message : Cannot insert the value NULL into column 'pubdate ', table 'titles'; column does not allow nulls. INSERT fails.

I am woerking with the internal team to get this fixed .

As I workaround in your case either update the below 
pubdate datetime2(0) NULL

OR
pass the pubdate  in the INSERT statement . 

 

Thanks
HImanshu

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Fabric Update Carousel

Fabric Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.