You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PATINDEX() function looks for the first occurrence of a pattern in the input string and returns the starting position of it.
Syntax of PATINDEX() function:
PATINDEX ( ‘%Pattern%’,input_string )
%Pattern%: In this argument, we specify the character expression that we want to look into the specified string. We might include the wild-characters as well in this argument
input_string: It is the string in which we want to search the pattern
CHARINDEX(substring, input_string)
Substring: Here, we define the substring that we want to search in the input string. We can specify a maximum of 8000 characters in this argument
Input_String: In this argument, we define the input string
Just like position, but with COLLATE support
SELECT Charindex('sqlshack.com', 'This is SQLSHACK.COM' COLLATE
latin1_general_cs_as)
Additional context
Those functions exist in MS SQL
The text was updated successfully, but these errors were encountered:
Use case
The PATINDEX() function looks for the first occurrence of a pattern in the input string and returns the starting position of it.
Syntax of PATINDEX() function:
PATINDEX ( ‘%Pattern%’,input_string )
CHARINDEX(substring, input_string)
Just like position, but with COLLATE support
Additional context
Those functions exist in MS SQL
The text was updated successfully, but these errors were encountered: