Important Function About SQL SUBSTRING Function
- The SUBSTRING() function extracts a substring from a string, starting at a specified position and with an optional length.
- It can be used with literal strings or columns in a table.
- The LEFT() and RIGHT() functions are also implementation of SUBSTRING() Function.
- Using SUBSTRING() in the WHERE clause negatively impacts the query performance, as the function will be executed for each row.
SQL Server SUBSTRING() Function
SUBSTRING function in SQL Server is used to extract a substring from a string, starting at a specified position and with an optional length.
It is very useful when you need to extract a specific portion of a string for further processing or analysis.
SQL SUBSTRING function also works in Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse.