StartsWith SQL FUNCTION
The function StartsWith works similar to .Net StartsWith 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 StartsWith(A, B) where A is a string and B is also a string. Function will check if string A starts with value of string B.
SELECT StartsWith('SQLDatabase.Net', 'sQ'); /* Will return false or zero since its case sensitive */
SELECT StartsWith(A, B, [ Ignore Case ]) 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.
Function will check if string A starts with value of string B in case sensitive if zero (0) is passed or will ignore than case if one (1) is passed.
SELECT StartsWith('SQLDatabase.Net', 'sQ' , 0 ); /* Will return false or zero since its case sensitive */
SELECT StartsWith('SQLDatabase.Net', 'sQ' , 1 ); /* Will return true or one since its case Insensitive */
SELECT StartsWith(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 StartsWith('SQLDatabase.Net', 'sQ' , 0, 'en-US' ); /* Will return false or zero since its case sensitive */
SELECT StartsWith('SQLDatabase.Net', 'sQ' , 1, 'en-US' ); /* Will return true or one since its case Insensitive due to 1 as thrid parameter. */
The starts with can be used in WHERE clause eg. WHERE StartsWith(ColumnName, 'SQL', 1) = 1;