Scalar-valued Functions [dbo].[IsNotNullOrWhiteSpace]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inStringnvarchar(max)max
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/*
* Returns true if the specified string is NOT null or whitespace, otherwise returns false.
* @param @inString - A nvarchar(max) to check for null/whitespace.
*/

create function [dbo].[IsNotNullOrWhiteSpace]
(
    @inString nvarchar(max)
)
returns bit
as
begin
    return
        case
            when @inString is not null and ltrim( rtrim( @inString ) ) <> '' then cast( 1 as bit )
            else cast( 0 as bit )
        end
end
GO
GRANT EXECUTE ON  [dbo].[IsNotNullOrWhiteSpace] TO [MssExec]
GO
Uses
Used By