Cleaning Right and Left Spaces in SQL Server

Hello everyone. In this article, I will give information about cleaning left and right spaces in SQL Server.

In SQL Server you may want to clear left and right spaces in some cases.

You can easily do this using the code below.

You can use the code below to clear left and right spaces in SQL Server 2017 and above.

SELECT
	TRIM(' Yavuz Selim Kart ') AS Sonuc

You can use the code below to clear left and right spaces in SQL Server 2016 and below.

SELECT
    LTRIM(RTRIM(' Yavuz Selim Kart ')) AS Sonuc

By using the codes above, you can clear the left and right spaces in the column.

Good luck to everyone in business and life.

27 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!