In this post, we will learn about how to replace newline characters from SQL fields. In this post, we have to use replace function for replace string and also use char function to remove newline characters and replace them. Here I will give you the syntax of replace function, how to use char function, and the meaning of 10 in char function.
Syntax
- REPLACE(string, string_to_replace, replacement_string)
- string - Source string
- string_to_replace - String to search for in string1
- replacement_string - Replacement string will be replaced string_to_replace with replacement_string in string1
What Char(10) in SQL. Execute the below selected query for checking what char(10) contains. Char(10) displays blank result in SQL query result which means it's \r or \n
- SELECT CHAR(10)
- REPLACE(EventNote, CHAR(10),'<br />')


Join the conversation! Your thoughts help the community grow.