SQL SERVER 自定义函数 返回表类型

1.创建函数

create function testFunTable(@count int)  
returns @temptale table (intcount int ,intcountAdd int)  
as  
begin 
 
    insert into @temptale values(@count,@count+1)  

    return  
end



2.调用函数

SELECT  * FROM  dbo.testFunTable(20)

 

3.结果

 

posted @ 2016-09-20 17:39  预立科技  阅读(32)  评论(0编辑  收藏  举报