You can try the following:
select * from yourtable where ltrim(rtrim(yourcolumn)) = ''
The idea is that if trimming the value leaves you an empty string, then everything that you had in the first place was a space.
You can also just do this:
select * from yourtable where yourcolumn like ' '
Please note that I checked the second query on SQL Server 2008 R2, and it does not work in 2014, as pointed out in comments by @ gunr2171
Finally, if you have a tab, carriage return, or line feed, the above will not work. What you can do is first replace these values ββwith an empty string, and then use the first query as follows:
select * from yourtable where ltrim(rtrim(replace(replace(replace(yourcolumn,char(9),''),char(10),''),char(13),''))) = ''
char(9) , char(10) and char(13) are used to display tabs, lines and carriage returns, respectively.
source share