My Blog List

hotinit.com. Powered by Blogger.

Search This Blog

CharIndex

Monday, 5 December 2011


select charindex('an','madhsan')
--output
6

select charindex('an','madhsan',1)
--output(as it searches from 1st character)
6

select charindex('an','madhsan',7)
--output (as it searches from 7nth characters)
0


select patindex('%an%','madhsancoolan')
--output (Patindex is charindex plus wildcardsearch)
6

No comments:

Post a Comment

 

Blogger news

Blogroll

Most Reading

8.6/10