SQL Server String Index Functions

Itsmemohanr
Posted by Itsmemohanr under Sql Server category on | Points: 40 | Views : 1801
DECLARE @string VARCHAR(50)
SET @string = 'This is mohan from IT'

LEN
PRINT len(@string)

CHARINDEX
PRINT charindex('is', @string) -- 1

PATINDEX
PRINT patindex('%m___n%', @string)

STUFF
PRINT stuff(@string, 6, 2, 'xx')

Comments or Responses

Login to post response