本文介绍了如何在一个存储过程中将数据插入多个表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我想在多表中的一个按钮上单击以插入数据

我有像
这样的桌子
1)Tbl_Product
pid,
pname,


2)Tbl_Schedule
sid,
pid,
开始日期,
已关闭,

3)Tbl_Brand
出价
pid,
brandName

现在我要在这三个表中插入
我使用过像
这样的存储过程

 插入 插入 Tbl_Product ( @ pname );

声明 @pid = @@ identity;

插入 插入 Tbl_Schedule ( @ pid  @ sdate  @ cdate );

插入 插入 Tbl_Brand ( @ pid  @ brandName ); 



帮帮我
谢谢....

解决方案


hii want to insert data on one button click in multile tables

i have tables like

1) Tbl_Product
pid,
pname,


2)Tbl_Schedule
sid,
pid,
startdate,
closedate,

3)Tbl_Brand
bid
pid,
brandName

now i want to insert in this three table
i used storeprocedure like

insert into Tbl_Product values (@pname);

declare @pid=@@identity;

insert into Tbl_Schedule values (@pid,@sdate,@cdate);

insert into Tbl_Brand values (@pid,@brandName);



help me
thanks....

解决方案


这篇关于如何在一个存储过程中将数据插入多个表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 22:57
查看更多