何时使用存储过程而不是嵌入式SQL [英] When to go for stored procedures rather than embedded SQL

查看:87
本文介绍了何时使用存储过程而不是嵌入式SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对何时使用存储过程而不是代码中的嵌入式SQL感到困惑

I am confused as when to go for stored procedures rather than embedded SQL in the code

当我用Google搜索出来时,我发现了这些要点

When I googled out, I found out these points

  • 它们允许模块化编程.
  • 它们可以减少网络流量.
  • 它们可以用作安全机制.

请告诉我网络流量与它有何关系?

Is please tell me how does network traffic is related to it ??

推荐答案

它们可以通过仅将所需数据返回给客户端来减少网络流量.

they can reduce network traffic by only returning the required data to the client.

或者扭转它;浪费网络流量的一种设计/编码实践是从数据库中选择一组数据,将其返回给客户端,然后在其中对某些数据集进行处理.显然,如果您正在处理某些数据集,那么从流量角度来看,最好不要将未处理的数据发送给客户端

Or to turn it around; a design/coding practice that can waste network traffic is to select a set of data from the DB, return it to the client and do processing there on some of the dataset. Obviously if you are working on some of the data set it would be better from a traffic perspective to not send to the client the data that is not being processed

这篇关于何时使用存储过程而不是嵌入式SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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