An explicit value for the identity column in table 'users' can only be specified when a column list

eclipse中tomcat console提示如下:

An explicit value for the identity column in table 'users' can only be specified when a column list is used and IDENTITY_INSERT is ON. 


users中的字段有:userid,username,passwd,grade

原始:

String sqlUpdate="insert into users values (null,?,?)";

数据库sqlserver2008R2

由于users中的userid设置为自动增长,所以不需要在插入时设置该值,修改为:

String sqlUpdate="insert into users values (?,?)";

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...