ITPub博客

首页 > 数据库 > SQL Server > MSSQL修改已有数据的表的自增列

MSSQL修改已有数据的表的自增列

原创 SQL Server 作者:o0yuki0o 时间:2017-03-09 09:35:20 0 删除 编辑
use demo
go


create table testid
([ID] [bigint] IDENTITY(1,1) NOT NULL,
col1 varchar(100),
[TMSTAMP] [timestamp] NOT NULL)




insert into testid(col1) values ('a')
insert into testid(col1) values ('b')
insert into testid(col1) values ('c')




create table testid2
([ID] [bigint] IDENTITY(1,1) NOT NULL,
col1 varchar(100),
[TMSTAMP] [timestamp] NOT NULL)


insert into testid2(col1) select col1 from testid
set IDENTITY_INSERT testid2 OFF


select * from testid2

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16131092/viewspace-2134977/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: AGStatus SQL
请登录后发表评论 登录
全部评论

注册时间:2014-02-26

  • 博文量
    90
  • 访问量
    75886