存储过程与函数的区别
来源:互联网 发布:access执行sql语句 编辑:程序博客网 时间:2024/05/22 16:48
本质上没区别。只是函数有限制只能返回一个标量,而存储过程可以返回多个。并且函数是可以嵌入在SQL中使用的,可以在SELECT等SQL语句中调用,而存储过程不行。执行的本质都一样。
The difference between UDF[User Defined Function] and SP[Store Procedure] in SQL Server Database:
1, UDF can only have input parameters and returned value, however, SP can both have input and output parameters.
2, Function must return value and must single value with return word, store procedure can return [n] values without return word. ( n>=0 ). When there are some output parameters in the store procedure then the n will be greater then one.
3, Function will be used in SQL clause, which return someone special value, but the SP are called to process a serials of business operation.
eg: create proc testProc
(
@testId int,
@statusCode int output
)
as
begin
declare @ret int
set @statusCode = 200
select @ret
end
存储过程和函数具体的区别:
总结:
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 函数与存储过程的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- 存储过程与函数的区别
- [20111124] 存储过程与函数的区别
- 函数生成的ALV的按钮列表 .
- 标签个性化数据在推荐排序中的应用
- Android提高第六篇之BroadcastReceiver(广播接收者)
- Kerberos相关资料整理
- c#面试问题
- 存储过程与函数的区别
- 未能同步iPad 因为这台电脑不再被授权使用在此iPad上购买的项目
- g++: error trying to exec 'cc1plus': execvp: 没有那个文件或目录
- 免费WiFi分享给你,全民免费WiFi来袭
- IOS-MVC设计模式深入
- 用Pix调试HLSL
- cocos2dx jni Android.mk配置,实现自动搜索.cpp文件打包
- hdu 4902 Nice Boat
- 【Twitter Storm系列】flume-ng+Kafka+Storm+HDFS 实时系统搭建