SQL Server String Index Functions

Itsmemohanr
Posted by Itsmemohanr under Sql Server category on | Points: 40 | Views : 1321
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