<p>In SQL Server 2017, you can use this syntax, but not in earlier versions:</p>

<pre><code>SELECT Name = TRIM(Name) FROM dbo.Customer;
</code></pre>

```
```
SELECT LTRIM(RTRIM(Names)) AS Names FROM Customer
```
```