创建sqlserver函数


CREATE FUNCTION getsort (@first varchar(100),@second varchar(100))
RETURNS  int
AS
BEGIN

declare @rv int

     if(@first=@second) set @rv=1
     else
set @rv=0
    -- Return the result of the function
    RETURN @rv

END
GO

原文地址:https://www.cnblogs.com/tiancai/p/4877776.html