SELECTs与存储过程 [英] SELECTs vs Stored Procedures

查看:83
本文介绍了SELECTs与存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在开发绑定到sql server数据源的vb.bet winform应用程序时,是否优先使用SELECT或存储过程来读取和写入
来自/到的数据

SQL Server?为什么?


谢谢


问候

Hi

When developing vb.bet winform apps bound to sql server datasource, is it
preferable to use SELECTs or stored procedure to read and write data from/to
SQL Server? Why?

Thanks

Regards

推荐答案

你好,


存储过程更好。它们更快更难以使用

sql注入攻击。


sql注入
http://msdn.microsoft.com/msdnmag/is.../SQLInjection/

http://msdn.microsoft.com/library/de...AGHT000002.asp


Ken

-------------------

Ken

-------------- -----

" John" <乔** @ nospam.infovis.co.uk>在留言中写道

新闻:ON ************** @ TK2MSFTNGP12.phx.gbl ...
Hi,

Stored procedures are better. They are faster and harder to use a
sql injection attack against.

sql injection
http://msdn.microsoft.com/msdnmag/is.../SQLInjection/

http://msdn.microsoft.com/library/de...AGHT000002.asp

Ken
-------------------
Ken
-------------------
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...


在开发绑定到sql server数据源的vb.bet winform应用程序时,是否更喜欢使用SELECT或存储过程从/向SQL Server读取和写入数据?为什么?

谢谢

关心
Hi

When developing vb.bet winform apps bound to sql server datasource, is it
preferable to use SELECTs or stored procedure to read and write data
from/to SQL Server? Why?

Thanks

Regards



John,


除了Ken之外,您还可以同时选择。


不同之处在于存储过程在服务器上并且更多

处理完成在服务器上,这使得你能够更快地检索数据。


我希望这会有所帮助,


Cor
John,

In addition to Ken, you use for both Select.

The differnce is that a stored procedure is on the Server and more
processing is done on the Server, which make your retrieving of data
something (or sometimes a lot) quicker.

I hope this helps,

Cor


嗨john


他们有预编译的计划,所以速度更快。


是的,确实可以防止SQL注入到一个不错的水平。


Shivprasad Koirala

C#,VB.NET,SQL SERVER,ASP .NET访谈问题
http://www.geocities.com/dotnetinterviews/

Hi john

They have there plans precompiled , so are faster.

Yes definetly prevents SQL Injection to a decent level.

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/


这篇关于SELECTs与存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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