自定义函数

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')

posted @ 2012-05-10 15:54  KyrieYang  阅读(192)  评论(0编辑  收藏  举报