我不知道你的用存储过程实现是什么意思,把表名作为参数?没这个必要吧。CREATE PROCEDURE pro_name as insert b.id,b.clsbh select a.id,a.clsbh from a go
a表字段为 id,clsbh,cph,B表字段为 id,clsbh,djrq,fsrq,bz. 用存储过程实现,把a表的所有clsbh都添加到b表的clsbh里 ----------------------------------假设两表通过ID字段关联 update b set b.clsbh = a.clsbh from a join b on a.id = b.id
问题有点不清楚,我想不是这么简单吧! CREATE PROCEDURE p_name as insert b.id,b.clsbh select a.id,a.clsbh from a go
update b set b.clsbh = a.clsbh from a where b.id = a.id
as
insert b.id,b.clsbh
select a.id,a.clsbh from a
go
a表字段为 id,clsbh,cph,B表字段为 id,clsbh,djrq,fsrq,bz. 用存储过程实现,把a表的所有clsbh都添加到b表的clsbh里
----------------------------------假设两表通过ID字段关联
update b set b.clsbh = a.clsbh from a join b on a.id = b.id
CREATE PROCEDURE p_name
as
insert b.id,b.clsbh
select a.id,a.clsbh from a
go