Monday, 14 April 2014

Get Character Index in sql server

1-Get Index of character
select CHARINDEX('FindWhat','String expression')
select CHARINDEX('1','0001')

Result-4

2- Get character of particular Index
select CHARINDEX('FindWhat','String expression',Index)

select CHARINDEX('1','000000000',1)
Result-0
select CHARINDEX('1','100000010',1)
Result-1
select CHARINDEX('1','100000010',2)
Result-8




No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...