存储过程,根据销售,购买和退货计算库存数量 [英] Stored procedure to calculate the quantity on hand based on sales, purchases and returns

查看:281
本文介绍了存储过程,根据销售,购买和退货计算库存数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以动态计算每件物品可用的数量或每次售出物品时计算?如果计算飞行,如何执行此操作的存储过程是什么。

Is it advisable to calculate on the fly , the qty available for every item or calculate it every time an item is sold? What is the stored procedure on how to do this if it is calculate don the fly.

推荐答案

从性能角度来看,不建议这样做。如果我要实施的话,我每次都会通过在非常销售或退货(如果申请)上添加或提交更新现有数量字段。通过在销售表上编写更新触发器可以更好地管理,这将自动更新手中的元素。
No it is not advisable from performomance point of view. If I was to implement I would have gone for updatting the Quantity In Hand field every time by adding or subtacting on very sale or return (if applicabale). This can be better manged by writing the update tigger on sales table which will automatically updated qunatity in hand.


是的,可以获得有关项目数量等的更新信息。要实现这一点,你需要使用 SQLDependency [ ^ ] class。



更多:

使用SqlDependency进行数据更改事件 [ ^ ]

在Windows应用程序中使用SqlDependency [ ^ ]
Yes, it's possible to get updated information about items count, etc. To achive that, you need to use SQLDependency[^] class.

More:
Using SqlDependency for data change events[^]
Using SqlDependency in a Windows Application [^]


这篇关于存储过程,根据销售,购买和退货计算库存数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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