You can use REPLACE() function to remove the spaces in the entire column or a string. Not only spaces, but you can also replace any character with another character. Here is the SQL query to remove all spaces from a string in SQL Server:
SELECT REPLACE(Column_Name, ' ', '')
I recommend checking out this SQL Tutorial to learn more about REPLACE() function.
You can learn in-depth about SQL statements, queries and become proficient in SQL queries by enrolling in an industry-recognized SQL training.