插入SQL Server时用于\ r \ n的字符 [英] Characters to use for \r\n when inserting into SQL Server

查看:754
本文介绍了插入SQL Server时用于\ r \ n的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从MySQL向SQL Server插入一些数据.我已经将MySQL表作为SQL插入语句转储到文本文件中.我可以将其插入SQL Server,但回车符将插入为\ r \ n而不是控制序列.如何替换MySQL插入语句中的\ r \ n字符串,以使它们最终在SQL Server中作为回车符结束?

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?

推荐答案

我能想到的唯一方法是将\r\n替换为' + CHAR(13) + CHAR(10) + '.

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

这篇关于插入SQL Server时用于\ r \ n的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆