存储过程里从表A取某个字段循环插入表B的问题 假设表A有数据id rt 1 ij2 ytt3 sg 表B数据:id rt bt…… …… ……我需要把表A的rt列全部插入到表B去:id rt bt3 ij aa4 ytt aa5 sg aa怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into b select id , rt , bt = 'aa' from a alter table A add CID int identity(1,1)alter table B add CID int identity(1,1)update B set rt=A.rtfrom Awhere A.CID=B.CID 我创建一个视图,总共有10条记录,我要在这个视图前加一ID列,从1到10,如何实现? 帮忙看一下这个SQL语句 求.....一个问题..都来看看!!!!!!!!!!!!!!! 不能在复制数据库的过程中分离该数据库 视图和表的问题 急求 请高手解救 谢谢。 再问大家数据库的还原问题。 请高手优化查询语句 sql 2005中表不能操作 analysis server +report service,接近疯狂!!! 我的机器上装不了SQL Server7.0了。 求一个绝对简单的触发器。在线等 数据库恢复回滚问题
alter table A add CID int identity(1,1)
alter table B add CID int identity(1,1)update B set rt=A.rt
from A
where A.CID=B.CID