Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1490
  • Last Modified:

update statement that will remove carriage return from field

I have some fields that have a carriage return within the field, this is throwing off my export.  Is there an update that I can do that will update all the fields to remove the carriage return?
0
yanci1179
Asked:
yanci1179
  • 4
  • 2
1 Solution
 
Patrick MatthewsCommented:
UPDATE SomeTable
SET SomeColumn = REPLACE(SomeColumn, CHAR(13), '')
0
 
Patrick MatthewsCommented:
To get line feeds too...

UPDATE SomeTable
SET SomeColumn = REPLACE(REPLACE(SomeColumn, CHAR(13), ''), CHAR(10), '')
0
 
yanci1179Author Commented:
thx!! how would you include in the where clause only those with feed or carriage returns?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Patrick MatthewsCommented:
yanci1179,

No need--the rows with no CR or LF will go unchanged.

Regards,

Patrick
0
 
yanci1179Author Commented:
thank you so much, you solved so many headaches!!
0
 
Patrick MatthewsCommented:
yanci1179,

Glad to help :)

Regards,

Patrick
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now