check for spaces in column
In a sql server 2008 r2 database column that is defined as varchar, how do you check to see if the field contains all spaces regardless of the length the field is?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abdu RafeeqPosted Oct 9, 2012, 12:35 PM
VulpesPosted Oct 6, 2012, 5:57 PM
SELECT someColumn FROM table WHERE RTRIM(someColumn) = ""
or, if you don't want to include columns containing empty strings: