8.9.09

What is patindex and charindex in SQL

Patindex: Returns the string position of the first occurrence of pattern
Ex: Select patindex(‘%o%’, ‘Microsoft’)
Note: % is must
Charindex: Same as patindex but you can specify the string position.
Ex: charindex ( Expression1, Expression2 [ , start_location])

No comments: