use yuyongTest
go
--定义一个函数,这个函数接收一个int型的输入,返回一个int性的值
create function dbo.getNum(@num int) returns int
as begin
return10+@num;
end
go
declare @num int;
select @num=dbo.getNum(20);
select @num;
执行结果:
use yuyongTest
go
--定义一个函数,这个函数接收一个int型的输入,返回一个int性的值
create function dbo.getNum(@num int) returns int
as begin
return10+@num;
end
go
declare @num int;
select @num=dbo.getNum(20);
select @num;
执行结果: