Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Characters to use for \r\n when inserting into 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?

like image 324
sipsorcery Avatar asked Jan 13 '10 01:01

sipsorcery


People also ask

What is N character in SQL?

The "N" prefix stands for National Language in the SQL-92 standard, and is used for representing Unicode characters. In the current standard, it must be an upper case , which is what you will typically find implemented in mainstream products.

What special characters are allowed in SQL?

Names can contain (but cannot begin with) the following special characters: 0 through 9, #, @, and $. Names specified as delimited identifiers (in double quotes) can contain additional special characters.


1 Answers

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

like image 178
codekaizen Avatar answered Sep 22 '22 22:09

codekaizen