INSERT into MyTab values(DEFAULT,'a','b') 运行错误!什么问题?
我想设计一字段id是自动编号
CREATE DATABASE MyDB
CREATE TABLE [MyTab] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[username] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
[password] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL
)
INSERT into MyTab values(DEFAULT,'a','b')
运行错误!什么问题?系统显示
Server: Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'MyTab' can only be specified when a column list is used and IDENTITY_INSERT is ON.