如何多次避免存储过程执行

编程入门 行业动态 更新时间:2024-10-09 23:18:17
本文介绍了如何多次避免存储过程执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨专家, 我要求你提出建议和想法来完成我的请求。 在我的网站上运行那些国家 。在我的工作流程中,在多个表中有太多插入,每天所有分支,他们每天都会得到报告。我用它来存储过程来生成报告。 becoz有很多连接标准。 我的观点是我有30个分支,所以每天最少40-50次执行。我的计划是单次执行存储过程然后获取所有分支的记录,然后在客户端尝试生成报告时将其推送到一个全局表意味着我们可以从全局表中获取报告数据。因为它是直接的(选择*来自globaltable,其中日期和分支而不是那么多的连接) 这是正确的方式或者请建议我任何其他方法来实现这一目标以提高系统性能。 我尝试过: 需要一个想法,以避免相同的程序执行多次。

Hi Experts, I'm request you the suggestions and ideas to accomplish my request. in my website running all over the countries . in my work flow there is too many inserts in multiple tables , everyday all the branches, they are getting daily basis report. which i was used stored procedure to generate report. becoz there is lot of joins criteria. my point is i've 30 branches so everyday minimum 40-50 executions will occur. my plan is single time i've execute the stored procedure then getting records for all branches and push it to one global table after that whenever client side trying to generate the report means we can get the report data from global table . because its direct (select * from globaltable where date and branch instead of so much of joins) is this right way or please suggest me any other way to achieve this to improve system performance. What I have tried: Need an idea to avoid same procedure execute multiple times.

推荐答案

由于SP同时运行,你必须在这里有创意... 想想这样的事情: As SPs borned to run simultaneously you have to be creative here... Think of something like this: 1. Check if there is a temp table by name of today date 2. No - create one and run the rest of the SP to push data into, then select data from the table 3. Yes - select data from the table

更多推荐

如何多次避免存储过程执行

本文发布于:2023-10-19 17:44:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1508292.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:存储过程

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!