如何给结果集添加一个序号 select IDENTITY(int,1, 1) as XH,name from tmpTbl 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select IDENTITY(int,1, 1) as XH,name into #aaafrom tmpTblselect * from #aaa IDENTITY必须和into语句一起使用,但是我的目标其实是想将选择的数据插入到一个已经有了数据的表中insert into strudents(class,name,Number)select class,name,IDENTITY(int,1,1) from tmpTbl. 加一个新列,然后declare @no intupdate table set 新列 = @no,@no = @no +1 临时表字符精度问题 关于SQL Server 方面 请高手帮助,合并数据到一个表中 SQL语句的疑问 计划任务问题 求一SQL语句应该不难的 请教 求助 请教大家一个数据库还原的问题,谢谢了! 多表(4)关联 插入语句 ^_ 表1,表2,表3 中的主键作为表4的字段,插入表4; 其中表4有自己的主键 请教全文索引的问题? 关于ado连接sqlsever的奇怪问题!请各位大侠帮助
into #aaa
from tmpTblselect * from #aaa
数据插入到一个已经有了数据的表中
insert into strudents(class,name,Number)
select class,name,IDENTITY(int,1,1) from tmpTbl.
update table set 新列 = @no,@no = @no +1