码迷,mamicode.com
首页 > 数据库 > 详细

sql 自定义函数

时间:2015-11-09 12:19:43      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:

create function dbo.fun(@inputid as varchar(40))
returns int
as
begin
declare @counts int
select @counts=COUNT(*) from Stu_Infor
return @counts
end

declare @input varchar(40)
set @input=2
select dbo.fun(@input)

自己写个小例子

http://www.cnblogs.com/no7dw/archive/2010/07/08/1773495.html

很详细

 

sql 自定义函数

标签:

原文地址:http://www.cnblogs.com/cylblogs/p/4949434.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!