SQL Notes 2
SQL Notes 2
A string function is a function that takes a string value as an input and the return
value (output) can be a string / numeric / character value.
In SQL Server, there are many built-in string functions that can be used by developers
say almost 50.
Why String Functions - They allow us to alter the individual characters in a string,
compare strings, search strings, to extract substrings, copy of a string. You can also use
these SQL String Functions to convert strings to lowercase or uppercase.
1. UCASE(string) / UPPER(string) - will convert the lower-case alphabets into upper case
of the string in the argument value.
LIKEWISE
3. SUBSTRING(string, pos, n) – Will return a new string from the main string ‘string’ from
the specified position ‘pos’ and of the length ‘n’.
n – will be a numeric value which will specify the total number of characters to be
returned as a new string.
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1
0 1 2 3 4 5 6 7 8 9 10
A R M A G E D D O N
*****************************