Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Removing records with spaces in fields

Author  Topic 

chava_sree
Yak Posting Veteran

56 Posts

Posted - 2008-03-26 : 20:43:06
How do i eliminate records which has spaces

i tried with

select * from table
where col1 !='' or
col1 is not null

which doesn't work.. any help.

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-26 : 21:58:04
select *
from tbl
where coalesce(rtrim(col1)), '') <> ''

if that doesn't work it's probably because they aren't spaces. Try looking at the ascii value.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -