D J Horton Consulting Ltd

Personal reference to useful tips and tricks for SQL Server, SQL Server Reporting Services and Crystal Reports.



My alternative to scraps of paper lying about.



Others may find bits of it useful!








Monday, 22 March 2010

Remove Carriage Return, Line Feed and Tab - SQL

Remove Carriage Return, Line Feed and Tab characters in T-SQL.

REPLACE(REPLACE(REPLACE(Field, CHAR(10), ''), CHAR(13), ''), CHAR(9), '')

3 comments:

Anonymous said...

I really appreciate your providing this tip to those of us who are chronically coming up against database problems like the one described.

I did change the char to chr for the version of Crystal I am using, but it works great!

Thanks so much!

Julie

Dom Horton said...

Julie,

Glad it was helpful. As you mentioned the syntax for Crystal differs slightly to that given in the T-SQL example.

regards,
Dom

Dom Horton said...

http://sqlreportingservicescrystalreports.blogspot.com/2009/10/condensing-large-character-string-and.html