Why is SQL server throwing this error: Cannot insert the value NULL into column 'id'?

前端 未结 13 1519
鱼传尺愫
鱼传尺愫 2020-11-27 05:35

I\'m using the following query:

INSERT INTO role (name, created) VALUES (\'Content Coordinator\', GETDATE()), (\'Content Viewer\', GETDATE())
13条回答
  •  天命终不由人
    2020-11-27 06:27

    You either need to specify an ID in the insert, or you need to configure the id column in the database to have Identity Specification = Yes.

提交回复
热议问题