Scalar-valued Functions [dbo].[IsNullOrWhiteSpace]
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 null or whitespace, otherwise returns false.
* @param @inString - A nvarchar(max) to check for null/whitespace.
*/

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