Sql substring function

 imageSubstring function in sql server extracts a portion of a string, this function troubled me in a couple of times with lack of awareness in string indexes




Now i cleared the ambiquity and so posting here


Select substring(stringth, start, length)


String = the main string

Start = from where extraction should start

Length = the total length from 0 th character of the string of main string


If we want to extract .’ef’ from ‘abcdef’

The select statement should be like

Select substring(‘abcdef’,5,6)

Ie. Extraction will start from the very start character to the very end


abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.

1 comment

Your Header Sidebar area is currently empty. Hurry up and add some widgets.