功能更好还是存储过程 [英] Is function better or stored procedure
本文介绍了功能更好还是存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个可以通过sp和函数完成的查询,所以我应该使用函数还是sp。哪一个更好,为什么??
I am having a query which can be done by both sp and function, so Should i have to use function or sp. which one is better and why??
推荐答案
这取决于您的要求。
尝试运行从您的页面以字符串格式查询而不是调用存储过程,您可能会看到性能提升,并且您将拥有更好的部署模型,这将更加强大(无需同时更新您的asp.net和数据库) 。
It depends on your requirements.
Try running the query in string format from your page instead of calling a stored procedure, you might see a performance gain and you will have a better deployment model which will be more robust (no need to update both your asp.net and database at the same time).
我无法在项目中定义一个结构,或者我可以使用函数或sp。所以,为了达到这个目的,我想知道功能是否更好。
I cant I am having a structure defined in the project either i can use function for that or sp. so, i jst wnt to know is function better then sp for this purpose.
只需 Google搜索 [ ^ ],您可能会发现许多结果。
Just Googling[^], you may find many many results.
这篇关于功能更好还是存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文