---切入数据库
USE zhangbei
----自定义函数定义
create function perimeter
(@S numeric(38,20))
returns numeric(38,20)
as
begin
declare @pi numeric(38,20)
set @pi = '3.1415'
return (select 2*@pi*sqrt(@S/@pi))
end
----执行语句
use zhangbei
select dbo.perimeter(100) as 圆周长