EndsWith SQL FUNCTION
The function EndsWith works similar to .Net EndsWith since it uses it in the backgroud. It requires minimum of two (2) string parameters and two more
optional parameters, by default search is case sensitive e.g. A and a are not the same. It returns 1 or 0 where 1 = true and 0 = false.
SELECT EndsWith(A, B) where A is a string and B is also a string. Function will check if string A ends with value of string B.
SELECT EndsWith('SQLDatabase.Net', 'Et') /* Will return false or zero since its case sensitive */ ;
SELECT EndsWith(A, B, [ Ignore Case ]) where A is a string and B is also a string but C is integer either 1 or 0 instructing ignore the case of characters.
Function will check if string A ends with the value of string B in case sensitive manner if zero (0) is passed, else it will ignore the case if one (1) is passed.
SELECT EndsWith('SQLDatabase.Net', 'Et' , 0 ) /* Will return false or zero since its case sensitive */ ;
SELECT EndsWith('SQLDatabase.Net', 'Et' , 1 ) /* Will return true or one since its case Insensitive */ ;
SELECT EndsWith(A, B, [ Ignore Case ] , [ Culture Name ]) where A is a string and B is also a string but [ Ignore Case ] is integer either 1 or 0 instructing ignore the case of characters and
finally the [ Culture Name ] is the name of Culture to use e.g. "en-US", "fr-FR" etc.
SELECT EndsWith('SQLDatabase.Net', 'Et' , 0, 'en-US' ); /* Will return false or zero since its case sensitive */
SELECT EndsWith('SQLDatabase.Net', 'Et' , 1, 'en-US' ); /* Will return true or one since its case Insensitive due to 1 as thrid parameter. */
The Ends with can be used in WHERE clause eg. WHERE EndsWith(ColumnName, 'Net', 1) = 1;