请给我您的宝贵答案,并感谢您的答复. [英] Please give me your valuable answers and thanks for responses.
本文介绍了请给我您的宝贵答案,并感谢您的答复.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以从SQL Server中的存储过程中调用函数吗?举任何例子.
Can we call function from stored procedure in SQL Server?Give any examples.
推荐答案
您可以参考:
^ ]&
^ ]
You can refer:
Function in SQL[^] &
How to call function in SQL Server stored procedure[^]
您好,
我们可以从存储过程中调用用户定义的函数.
喜欢,
选择dbo.FunctionName(函数参数)AS函数返回值
来自TableName
函数传递参数应该在select语句中.
喜欢,
选择A1,A2,A3,dbo.FunctionName(A1,A2)AS AValue from TableName
谢谢,
Viprat
Hello,
We can call user defined function from from the stored procedure.
like,
Select dbo.FunctionName(parameters of function) AS Function Return Value
From TableName
Function passing parameter should be in select statement.
Like,
Select A1, A2,A3, dbo.FunctionName(A1,A2) AS AValue From TableName
Thanks,
Viprat
是
因为,
存储过程由一个或多个 sql查询
在sql查询中,我们可以调用函数,因此,也可以说可以在存储过程中调用函数
这是一个如何在sql查询中调用函数的示例
例如
yes
because,
store procedure consist of one or more sql queries
and In sql query we can call function so, alternately we can say that we can call function in store procedures
here is an example how to call function in sql query
e.g.
select getdate() --getdate() is sql-function
用户定义函数的调用方式相同.
例如
same way user-defined function can be called.
e.g
select dbo.fn_OnlyDate() --suppose, onlydate is user-defined sql function; (dbo is schema name because user defined function are accessed using schema name- just for your knowledge.)
祝您编码愉快!
:)
Happy Coding!
:)
这篇关于请给我您的宝贵答案,并感谢您的答复.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文