如何执行功能 [英] how to execut e a function
本文介绍了如何执行功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何执行用户定义的函数,否则我们将无法执行用户定义的函数.
how to execute a user defined function or we cannot able to execute the user defined function.
推荐答案
您可以按以下方式执行函数:
创建函数.
You can execute the function as follows:
Create the function..
Create function Test(@i int)
returns int
as
begin
return @i+2
end
calling the function:
select dbo.Test(2);
如果您的函数返回表,那么您还可以查询为:
从dbo.function_name()中选择*
If your function returns table, then you can also query as:
select * from dbo.function_name()
尝试以下操作:
http://msdn.microsoft.com/en-us/magazine/cc164062.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/w2kae45k%28v = vs.80%29.aspx [ ^ ]
try these:
http://msdn.microsoft.com/en-us/magazine/cc164062.aspx[^]
http://msdn.microsoft.com/en-us/library/w2kae45k%28v=vs.80%29.aspx[^]
这篇关于如何执行功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文