APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse. Returns part of a character, binary, text, or image expression in SQL Server. Transact-SQL Syntax Conventions. The position to start extraction from. The first position in the string is always 1. The number of characters to extract.

The Substring function in SQL is used to return a portion of the string. SUBSTR - Get Substring from String - Oracle to SQL Server Migration. In Oracle, SUBSTR function returns the substring from a string starting from the specified position and having the specified length (or until the end of the string, by default). The starting position for extraction.
It is the number of characters to extract. If this parameter is omitte the SUBSTR function will return the entire string. If substring _length is less than then Oracle returns null. CHAR, VARCHAR NCHAR, NVARCHAR CLOB, or NCLOB. Both position and substring _length must be of datatype NUMBER, or any datatype that can be implicitly converted to NUMBER, and must resolve to an integer.
So executing this query shows a window of the string that has been passed to it. SUBSTRING includes spaces as a position within a string. If you omit the length argument, the length of the substring will be the length of the string minus the starting position.


