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 2000 Forums
 SQL Server Development (2000)
 Cleaning hidden embedded characters

Author  Topic 

Razzar
Starting Member

1 Post

Posted - 2005-03-30 : 18:05:18


using ms sql server -

I am pulling records from another db. hidden inside these records are <CR> or <CRLF> or <LF> and several other ansi characters. These are not visible.

The problem is that they are not visible. I found them only by chance when doing a drop to file and noticed the records creating a new line - i did a search and replace and found the above hidden chars.

Is there a way to find hidden/ansi chars and clean them out. Otherwise i may have to go search for them one at a time.

Thanks ahead of time

nr
SQLTeam MVY

12543 Posts

Posted - 2005-03-30 : 18:33:03
select 1
declare @str varchar(20)
select @str = '%[^0-9a-zA-Z]%'
while @@rowcount > 0
update tbl
set fld = replace(fld, substring(fld,patindex(@str, fld),1),'|')
where fld like @str


pick your own @str and replace character.

==========================================
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 -