In this post explains how to use the SUBSTRING function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the SUBSTRING functions allows you to extract a substring from a string.
The syntax for the SUBSTRING function in SQL Server (Transact-SQL) is:
The source string to extract from.
The position to start extraction from. The first position in the string is always 1.
The number of characters to extract.
The SUBSTRING function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server SUBSTRING function examples and explore how to use the SUBSTRING function in SQL Server (Transact-SQL).
For example: