哪个更适合返回简单值:查看,存储过程或功能? [英] Which is Better for Returning Simple Value: View, Stored Proc or Function?

查看:74
本文介绍了哪个更适合返回简单值:查看,存储过程或功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用与sql server db绑定的Access 07项目。在我不断努力优化应用程序性能的过程中,我想知道哪个更好地返回一个变量的简单值:视图,存储过程或函数?这里有两个例子:

展开 | 选择 | Wrap | 行号

解决方案

创建Pass-Through查询将是最快的。它必须用MS-SQL编写,请查看帮助以获取详细信息。


Nic; o)


我不认为我有一个在.adp中工作的选项。我确实记得当我在.mdb中工作时看到它。


当直接使用MS SQL视图和过程时,视图将作为一个过程更快(当没有过程时)在视图中使用了)。视图由数据库引擎执行,该过程将需要解释器来执行代码,并且通常记录集处理作为查询/视图较慢。


Nic; o)

I''m working in an Access 07 project tied to a sql server db. In my continuing effort to optimize application performance I would like to know which is better at returning just a simple value for a variable: a view, stored proc, or function? Here are two examples:

Expand|Select|Wrap|Line Numbers

解决方案

Creating a "Pass-Through" query will be the fastest. It will have to be written in MS-SQL, check the help for details.

Nic;o)


I don''t think I have that option working in a .adp. I do remember seeing it when I was working in an .mdb, however.


When working directly with MS SQL views and procedures, the view will be faster as a procedure (when no proc''s are used in the view). A view is executed by the database engine, the procedure will require an interpreter to execute the code and in general recordset processing is slower as a query/view.

Nic;o)


这篇关于哪个更适合返回简单值:查看,存储过程或功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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