I'm attempting to insert some data from MySQL to SQL Server. I've dumped the MySQL table to a text file as SQL insert statements. I can insert it into SQL Server ok but the carriage returns are inserting as \r\n rather than as control sequences. How can I replace the \r\n strings in the MySQL insert statements so that they will end up as carriage returns in SQL Server?
+3
A:
The only way I can think of is to replace \r\n
with ' + CHAR(13) + CHAR(10) + '
.
codekaizen
2010-01-13 01:33:48
+1, lol, I just wrote same code =)
Rubens Farias
2010-01-13 01:35:33
+1, and you are spot on. replace( variable_or_fieldname, '\r\n', CHAR(13) + CHAR(10) )
Gaby
2010-01-13 01:36:09
A:
Just replace the \r\n escape sequence with a line break. Example:
select 'This is
a multi-line
string'
Guffa
2010-01-13 01:35:35