Tip of the Day : Example Uses of the LOWER String Function

Welcome to SQL Server Helper !!!

This site is intended for those who are beginning to use SQL Server as part of their day-to-day activities.  You will find in this site a collection of useful functions, triggers, stored procedures and tips and tricks related to SQL Server.

Should you have any comments or questions regarding this site or if you want to ask SQL Server-related questions, e-mail us here.

We hope we are able to help and we are glad to help!!!

SQL Server Tip of the Day - November 11, 2025

Example Uses of the LOWER String Function

The LOWER string function returns a character expression after converting uppercase character data to lowercase.  The syntax of the LOWER string function is as follows:

LOWER ( < character_expression > )

The < character_expression > is an expression of character or binary data.  < character_expression > can be a constant, variable or column and it must be of a data type that is implicitly convertible to VARCHAR; otherwise, the CAST function needs to explicitly convert < character_expression >.

Here are sample uses of the LOWER string function

Usage #1 : Determine if All Characters in a String are in Lower Case

DECLARE @Input                VARCHAR(20) = 'sql server helper'
 
SELECT CASE WHEN LOWER(@Input) = @Input COLLATE Latin1_General_BIN
            THEN 'Yes'
            ELSE 'No' END AS [IsAllLowerCase]
 
IsAllLowerCase
---------------
Yes

Usage #2 : Determine if a Character is a Letter of the Alphabet

DECLARE @Input1           CHAR(1)
DECLARE @Input2           CHAR(1)
 
SET @Input1 = '1'
SET @Input2 = 'A'
SELECT CASE WHEN ASCII(LOWER(@Input1)) != ASCII(UPPER(@Input1))
            THEN 'Yes'
            ELSE 'No' END AS [IsAlphabet1],
       CASE WHEN ASCII(LOWER(@Input2)) != ASCII(UPPER(@Input2))
            THEN 'Yes'
            ELSE 'No' END AS [IsAlphabet2]
 
IsAlphabet1   IsAlphabet2
------------  ------------
No            Yes

SQL Server 2012

SQL Server 2008

User-Defined Functions

Date Functions

A collection of useful user-defined functions that deal with dates.

String Functions

A collection of useful user-defined functions that deal with strings (varchar/char/nvarchar/nchar).

Tree Functions

A collection of useful user-defined functions that deal with tree or hierarchical design structures.

Table-Valued Functions

A collection of useful table-valued user-defined functions that can be used to join with other tables.

SQL Server Built-in Functions

A reference to all built-in functions available within SQL Server grouped into categories.

Tips and Tricks

A collection of useful SQL Server-related tips and tricks:

SQL Server Error Messages

A list of SQL Server error messages and for certain error messages, discusses ways on how to solve the error or work around them:

Frequently Asked Questions