首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

一个简单的sql有关问题,有办法给一个表添加ID 列

2012-01-18 
一个简单的sql问题,有办法给一个表添加ID 列我想随便一个表,我想给这个表加一个ID列,但不用identity()函数

一个简单的sql问题,有办法给一个表添加ID 列
我想随便一个表,我想给这个表加一个ID列,但不用identity()函数去into   到另一个表,能够直接在本表添加。
请高手们指点

[解决办法]
create table test(col int)
insert test select 1
union all select 2

alter table test add id int identity(1,1)

select * from test

[解决办法]
alter table test add id int identity(1,1)
[解决办法]
alter table test add id int identity(1,1)

热点排行