SUBSTRING(): starts at a position and counts characters to the right, returning a substring of a specified length : Substring « String Functions « SQL Server / T-SQL






SUBSTRING(): starts at a position and counts characters to the right, returning a substring of a specified length


1> -- SUBSTRING(): starts at a position and counts characters to the right, 
returning a substring of a specified length.
2>
3> DECLARE @FullName VarChar(25)
4> SET @FullName = 'www.java2s.com'
5> SELECT SUBSTRING(@FullName, 4, 6)
6> GO

------
.java2

(1 rows affected)
1>
2>
           
       








Related examples in the same category

1.SUBSTRING(string_to_remove_string_from, start_position, length)
2.Substring: get the substring
3.Combine Lower() Upper() and substring() function to capital the first letter in a word