如何从表输出将参数传递给标量值函数 [英] How to pass parameters to a scalar value function from a table output

查看:106
本文介绍了如何从表输出将参数传递给标量值函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有我都是新来的,使用此标量值UDF,我有一个要求,我要获得约5行,6列的输出,并且我有一个sclar函数,需要从上表发送参数并必须保持输出到varible并且必须显示它,所以对于5行,我必须提供5个输出,任何人都可以指导我如何做,我用google搜索过它,但是我无法跟随它,请帮助我让我

HI all i am new using this scalar valued UDF,i had a requirement where i get an output of around 5 rows with 6 columns , and i have a sclar Function where i need to send parameters from above table and have to hold the output in to varible and have to display it , so for 5 rows i have to gert 5 outputs , can any one guide me how to do it ,i googled about it but i am unable to follow it ,please help me out let me know if am not clear with the Question.

推荐答案

这是一个如何使用select语句调用标量函数的模型
This is a model of how to call scalar function with select statement
select  col1,
        col2,
        col3,
        dbo.myScalarFunction( col1,col2,col3) as ScalarResultColumn
from    myTable


可能是错误的,但我知道您需要从函数中返回几行.如果正确的话,这里有一个示例:在SQL Server中使用表值函数 [ ^ ]
Could be wrong but I understood that you need to return several rows from the function. If that''s correct, here''s one example: Using Table-Valued Functions in SQL Server[^]


这篇关于如何从表输出将参数传递给标量值函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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