set IDENTITY_INSERT on 和 off 的设置

格式:
  set IDENTITY_INSERT 表名 on
  set IDENTITY_INSERT 表名 off

举例:

set IDENTITY_INSERT peoplePworkpositiontype  on
insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(1 , '平台' , 1 ) 
insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(2 , '陆地' , 2 ) 
insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(3 , '海上' , 3 )

go
set IDENTITY_INSERT peoplePworkpositiontype  off


set IDENTITY_INSERT peoplePstatetype  on
insert peoplePstatetype(id,nowstatetype,nowstatetypeid) values(1 , '出海' , 1 ) 
insert peoplePstatetype(id,nowstatetype,nowstatetypeid) values(2 , '出差' , 2 ) 
insert peoplePstatetype(id,nowstatetype,nowstatetypeid) values(3 , '公司' , 3 ) 
insert peoplePstatetype(id,nowstatetype,nowstatetypeid) values(4 , '会议' , 4 ) 
go
set IDENTITY_INSERT peoplePstatetype  off
go
赞(0)
未经允许不得转载:TaKaSa » set IDENTITY_INSERT on 和 off 的设置