SELECT LTRIM(RTRIM([Name])) AS [Name] FROM TableName WHERE CHARINDEX(' ', LTRIM(RTRIM([Name]))) = 0
WHERE Name NOT LIKE '%[^ ]% [^ ]%'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)