sql server 自定义函数的使用

create function test(@Num varchar(20))

returns varchar(50)   --返回值类型

select dbo.test(2)  --传递参数2


create function GetTableDetails()

returns TABLE

as
 return (select * from sales)

 

select * from dbo.GetTableDetails()

 

全力参考:https://www.cnblogs.com/diony/archive/2010/12/17/1909014.html

     https://www.cnblogs.com/lideng/archive/2013/04/15/3022418.html

     https://www.cnblogs.com/csdbfans/p/3514538.html

     http://blog.csdn.net/qingheshijiyuan/article/details/50469535

 

存储过程:https://www.cnblogs.com/DBArtist/p/transaction.html

posted @ 2017-12-21 15:34  查克拉的觉醒  阅读(177)  评论(0编辑  收藏  举报