Friday, September 4, 2009

What is patindex and charindex in SQL

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

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates