February 17, 2023 at 12:00 am
Comments posted to this topic are about the item A NOT NULL Default
February 17, 2023 at 12:33 am
This has the same output, what have I missed?
Msg 515, Level 16, State 2, Line 6
Cannot insert the value NULL into column 'myid', table 'database.dbo.NotNullTable'; column does not allow nulls. INSERT fails.
The statement has been terminated.
SET ANSI_NULL_DFLT_ON OFF
GO
CREATE TABLE NotNullTable
( myid INT)
GO
INSERT dbo.NotNullTable (myid) VALUES (NULL)
GO
DROP TABLE dbo.NotNullTable
GO
February 17, 2023 at 7:57 am
What the other Ed said.
Edward
February 17, 2023 at 9:57 am
Isn't this not the answer we weren't looking for 🙂
February 17, 2023 at 11:07 am
set ansi_null_dflt_ON OFF
create table TDfTest(i int)
insert into TDfTest values (NULL)
--Cannot insert the value NULL into column 'i', table 'test.dbo.TDfTest'; column does not allow nulls. INSERT fails.
February 17, 2023 at 6:03 pm
Arhh, poor testing matrix. Question allows either answer and points awarded back
February 20, 2023 at 9:08 am
Why would anyone want to turn off standard ANSI defaults? I thought these options were a legacy thing. Or is there some real reason to sue them still that I'm not aware of?
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply