Inconsistent SQL Server Management Studio results regarding CHAR (13) + CHAR (10)

I have a problem with consistency across different versions of SQL Server. With the following code:

DECLARE @text NVARCHAR(50)
SET @text = 'This is line 1.' + CHAR(13)+CHAR(10) + 'This is line 2.'
SELECT @text

I copy and paste the results into notepad

SQL Server 2008R2 shows

This is line 1. This is line 2.

SQL Server 2014 shows

This is line 1.
This is line 2.

Any idea how I can fix this? Or why is this so? I want to achieve the latter.

Thanks in advance

+4
source share
1 answer

I tried in SQL Server 2008 R2 (SP2). You do not have the problem you specified.

, , Grid, .

0

Source: https://habr.com/ru/post/1657446/


All Articles