I'm using the following query:
INSERT INTO role (name, created) VALUES ('Content Coordinator', GETDATE()), ('Content Viewer', GETDATE())
However, I'm not specifying the primary key (which is id). So my questions is, why is sql server coming back with this error:
Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'id', table 'CMT_DEV.dbo.role'; column does not allow nulls. INSERT fails. The statement has been terminated.
Your Answer
0 answers
Hot tools Tags
Hot Questions
MySQL performance: multiple tables vs. index on single table and partitions
2025-12-30 12:22:38
Add 2 hours to current time in MySQL?
2025-12-30 12:01:11
What is the difference between the dot (.) operator and -> in C++? [duplicate]
2025-12-30 11:43:11
Get cookie by name
2025-12-30 11:22:29
How to use django models with foreign keys in different DBs?
2025-12-30 11:01:11
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
Douyin level price list 1-75
20416
7
20416
7
wifi shows no ip assigned
13573
4
13573
4






