Created
January 2, 2018 16:20
-
-
Save codenamejason/97719c9eb4592cb98e7175af8fd3f986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[IsLowerCase]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) | |
DROP FUNCTION [dbo].[IsLowerCase] | |
GO | |
CREATE FUNCTION [dbo].[IsLowerCase] | |
( | |
@Char char | |
) | |
RETURNS BIT WITH SCHEMABINDING | |
AS | |
BEGIN | |
DECLARE @IsLowerCase BIT | |
IF isNumeric(@char) = 1 | |
return (cast (0 as Bit)) | |
if (CAST(@Char AS VARBINARY) = CAST(LOWER(@Char) AS VARBINARY)) | |
SELECT @IsLowerCase = CAST(1 AS BIT) | |
ELSE | |
SELECT @IsLowerCase = CAST(0 AS BIT) | |
RETURN @IsLowerCase | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment