Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

MSSQL – Remove Line Breaks

Posted on December 15, 2014October 26, 2015 By David Kittell

Sometimes you need to remove line breaks or carriage returns, the code below should help.

SELECT REPLACE(REPLACE([VarChar Column], CHAR(13), ' '), CHAR(10), ' ')

The above script will not work if the column type is TEXT so you must convert it first.

SELECT REPLACE(REPLACE(CAST([TEXT Column] AS VarChar(Max)), CHAR(13), ' '), CHAR(10), ' ')
Originally Posted on December 15, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL

Post navigation

Previous post
Next post

Related Posts

Ektron Alias With Folder Name

Posted on February 25, 2014October 26, 2015

With assistance from my Ektron Content Folder Names script this script will display all aliases with the folder that the content belongs to. This is not an ideal process as you can have many folders in Ektron but this can help. SET NOCOUNT ON DECLARE @Domain VARCHAR(50) SET @Domain =…

Read More

Concatenate Address Columns In One Column

Posted on August 7, 2015October 17, 2021

In many databases the address is properly separated into various columns but in a report you want to concatenate them. This simple script will pull them together in one column without causing extra spaces SELECT ltrim(isnull([address], ”) + ‘ ‘ + isnull([address2], ”) + ‘ ‘ + isnull([city], ”) +…

Read More

Show Windows Version On Desktop

Posted on November 9, 2013October 26, 2015

WARNING: Backup the computer you try these scripts on before you run these. Windows Registry Editor Version 5.00 [[HKEY_CURRENT_USERControl PanelDesktop] "PaintDesktopVersion"=dword:00000000 Originally Posted on November 9, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any source code or program…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes