自动生成唯一编号 select identity(int1,1) as id,* from table 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select identity(1,1) as id,* into #tem from tablegoselect * from #tem select identity(int,1,1) as id,* into #tem from tablegoselect * from #tem 1.select id=identity(int,1,1),* into #tb from 表select * from #tb --从临时表中查结果drop table #tb --删除临时表 2.alter table 表 add id int identity(1,1) --为查询添加标识字段select * from 表 --查询结果alter table 表 drop column id --删除为查询准备的标识字段 alter table 表 add id int identity(1,1) --为查询添加标识字段select * from 表 --查询结果alter table 表 drop column id --删除为查询准备的标识字段 求高手帮我写段代码,很莱鸟~ 搜索数据库里面所有表的所有字段内容sql 请懂配置SQL Server 2005端口的朋友快进!! 高手请进,有挑战性的问题 快速回答 SQL语句 从一张表导入另一张表的问题! 怎样将datetime类型转换为char类型? ODBC问题,会的请进来指导,不会的也来学学! 远程连接MS SQLSERVER2005. error -26 小弟不才,想请教各位一个存储过程分页的问题 Sql Server2000一个表几百个列,操作效率如何 立即给分,关于asp调用sqlserver存储过程返回值问题。
go
select * from #tem
go
select * from #tem
select id=identity(int,1,1),* into #tb from 表
select * from #tb --从临时表中查结果
drop table #tb --删除临时表
alter table 表 add id int identity(1,1) --为查询添加标识字段
select * from 表 --查询结果
alter table 表 drop column id --删除为查询准备的标识字段
select * from 表 --查询结果
alter table 表 drop column id --删除为查询准备的标识字段