I don't understand the problem. Are you asking how to use your SQL statement for a column in a table? Like this?

SELECT LEN(YourColumn) - LEN(REPLACE(YourColumn, ' ', '')) + 1
AS Results
FROM YourTable