CREATE FUNCTION getsort (@first varchar(100),@second varchar(100))RETURNS intASBEGINdeclare @rv intif(@first=@second) set @rv=1 elseset @rv=0 -- Return the result of the function RETURN @rvENDGO