开发者

Characters to use for \r\n when inserting into SQL Server

开发者 https://www.devze.com 2022-12-16 18:32 出处:网络
I\'m attempting to insert some data from MySQL to SQL Server. I\'ve dumped the M开发者_Python百科ySQL table to a text file as SQL insert statements. I can insert it into SQL Server ok but the carriage

I'm attempting to insert some data from MySQL to SQL Server. I've dumped the M开发者_Python百科ySQL 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?


The only way I can think of is to replace \r\n with ' + CHAR(13) + CHAR(10) + '.


Just replace the \r\n escape sequence with a line break. Example:

select 'This is
a multi-line
string'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号