Tuesday 5 May 2020

Replace a newline in TSQL

https://stackoverflow.com/questions/951518/replace-a-newline-in-tsql


Actually a new line in a SQL command or script string can be any of CR, LF or CR+LF. To get them all, you need something like this:
SELECT REPLACE(REPLACE(@str, CHAR(13), ''), CHAR(10), '')

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive