Leading whitespace is a common issue when working with data. A leading whitespace is a space at the start of a string. In most cases, we don’t want any leading whitespace, and we will want to remove it before the data goes any further (whether that means being stored in the database, displayed to the user, or whatever).
Fortunately, SQL Server provides us with the LTRIM()
function that allows us to remove leading blanks from a given string.