将数据插入2个表一对多关系 [英] Insert data into 2 tables one-to-many relation

查看:170
本文介绍了将数据插入2个表一对多关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

外部存储站点被阻止我们的防火墙。将图像附加到线程本身。


你说SP没有达到你的观点。但你没有告诉我们什么是点。是的,我们无法帮助你。
External storage sites are blocked by our firewalls. Attach the image to the thread itself.

You said the SP doesn''t achieve your point. But you haven''t told us what the "point" is so there''s nothing we can help you with.


感谢您的回复,我有2个表,其中一个是OrderProduct(orderId PK,ProdctName,Quantity,Price)将客户想要的项目列表逐个存储,第二个表我将其命名为Transaction(TrnId PK,orderId fK,Datetime),它假设将订单列表分组为一个TrnId,所以这两个表之间的实现是一个(TrnId)到多个(订单)。

在我的SP中我只是存储订单而没有指定TrnId,

Actully我想编制销售表格。

我不知道你对图像的意思是什么!

我希望现在我的观点很明确,我很抱歉我的第一个不好的描述..
Thank you for your reply, I have 2 tables one of them is OrderProduct (orderId P.K.,ProdctName,Quantity,Price)which store the list of items that the customer want one by one , the second table I named it Transaction(TrnId P.K.,orderId f.K.,Datetime) which it suppose to group the list of Orders by one TrnId, So the realtion between these 2 tables is one(TrnId)-to-many(Orders).
In my SP I just store the orders without specifying TrnId ,
Actully I want to program the selling form.
I don''t know what do you mean about the image!
I hope to be my point is clear now , and I''m sorry for my first bad description..


你还没有解释你遇到了什么问题。您说您想要在没有交易的情况下存储订单。这是没有意义的,因为现在你无法将订单绑定到交易。但除此之外,你还需要解释你实施的问题。它给你一个错误吗?什么是错误代码?它不按你想要的方式工作吗?它做了什么呢?它应该如何工作?什么是样本数据和结果?


我对图像的评论是您使用网站存储图像。我的防火墙阻止该网站,所以我看不到图像。将图像附加到论坛帖子。
You still haven''t explained what problem you''re having. You said you want to store the order without transaction. Which doesn''t make sense because now you have no way of tying the order to the transaction. But aside from that, you still need to explain what problem you''re having implementing that. Is it giving you an error? What''s the error code? Is it not working the way you want? What is it doing instead? How should it work? What is some sample data and results?

My comment about the image is that you used a site to store the image. My firewall blocks that site, so I can''t see the image. Attach the image to the forum thread.


这篇关于将数据插入2个表一对多关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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