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

233 阅读1分钟

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.结果