如何在同一存储过程中插入两个不同的表 [英] How to insert into two different table in same stored procedure

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

问题描述

我想在不同的表中插入两个不同的数据,两个表都没有加入或链接,然后我想在datagridview中看到插入的数据



我尝试过:



i want to insert two different data in different tables and both tables not join or link and then i wanted to see inserted data together in datagridview

What I have tried:

insert into article-production(code,name,weight)values(@code,@name,@weig‌​ht,(select buyer from setup where id =@id)

推荐答案

如果是存储过程,只需使用两个插入语句



If it is a stored procedure just use two insert statements

insert into table1 (...) values (...)

insert into table2 (...) values (...)





我们无法帮助解决您的显示问题,因为我们不了解您的桌子或您想要展示的内容。我们只知道您的问题告诉我们,我们无法访问您的代码或者你的数据库,我们无法理解你的想法。



We can't help you with your display issue as we don't know about your tables or what you want to show. We only know what you tell us, we can't access your code or your database and we can't read your mind.


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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆