自定义函数

create function chengji(@inputkc as varchar(10))  --定义参数 声明参数类型
returns @chji Table --表类型  返回值
(
    xs_name varchar(10),
    xf int
)
as
begin
    insert  @chji
    select xs.xs_name,xs.xf from xs where xs_name=@inputkc
    return
end
select * from dbo.chengji('wj')

原文地址:https://www.cnblogs.com/yzenet/p/2494475.html