创建自定义函数:
use 数据库名gocreate function 函数名(@pno int)returns intasbegin declare @a int if not exists(select * from person where pno=@pno) set @a=-1 else set @a=1 return @aend调用函数:use 数据库名goselect dbo.函数名(13250)本文共 268 字,大约阅读时间需要 1 分钟。
创建自定义函数:
use 数据库名gocreate function 函数名(@pno int)returns intasbegin declare @a int if not exists(select * from person where pno=@pno) set @a=-1 else set @a=1 return @aend调用函数:use 数据库名goselect dbo.函数名(13250)转载于:https://www.cnblogs.com/tomahawk/p/4013961.html