Pages

Friday 11 January 2013

UDF Check IsNull or Empty

CREATE FUNCTION [dbo].[IsnullorEmpty]
(
    @Photo varchar(max)
   
)
RETURNS bit
AS
BEGIN
    Declare  @Result bit
    IF (@Photo IS NULL) OR (@Photo = '')
        BEGIN
            SET @Result=0
        END
    ELSE
        BEGIN
            SET @Result=1
        END
    -- Return the result of the function
    RETURN @Result

END

No comments:

Post a Comment