

I am the creator of one of the biggest free online collections of articles on a single topic, with his 50-part series on SQL Server Always On Availability Groups.īased on my contribution to the SQL Server community, I have been recognized as the prestigious Best Author of the Year continuously in 2019, 2020, and 2021 (2nd Rank) at SQLShack and the MSSQLTIPS champions award in 2020. Note: If you are migrating an entire database from a supported database server (on-premises, in AWS or Google Cloud) to a new Cloud SQL instance, you can use the Database Migration. I published more than 650 technical articles on MSSQLTips, SQLShack, Quest, CodingSight, and SeveralNines. To export data from Cloud SQL for use in a MySQL instance that you manage, see Exporting and importing using SQL dump files or Export and import using CSV files. I am the author of the book " DP-300 Administering Relational Database on Microsoft Azure". Hi! I am Rajendra Gupta, Database Specialist and Architect, helping organizations implement Microsoft SQL Server, Azure, Couchbase, AWS solutions fast and efficiently, fix related issues, and Performance Tuning with over 14 years of experience. Execute this query in SSMS and view output in Result to text (short cut key CTRL + T) format: We use a comma to separate the name of the month. Suppose we have a string that contains a month’s name. Let’s explore these ASCII codes with CHAR functions with examples. We can use the following ASCII codes in SQL Server: In SQL Server, we can use the CHAR function with ASCII number code. We might require inserting a carriage return or line break while working with the string data. Insert SQL carriage return and line feed in a string With the disabled option of retain CR/LF on copy or save: With the enabled option of retain CR/LF on copy or save: It shows that while copying output to notepad or excel sheet, SQL Server does not retain SQL carriage return on copy/save: In SSMS 2016 and higher, we can see that “Retain CR/LF on copy or save” checkbox is not ticked. Navigate to Tools | Options | Query Results | SQL Server | Results to Grid. SSMS allows us to define the carriage return behavior as well. It does return to the beginning of the line


SSMS 2016 and higher removes carriage return. We might get different behavior of the carriage return with different versions of SSMS. It retains the carriage return as well while copying the output in notepad or excel: You can see that in both notepad and excel sheet row one and two splits in multiple lines. Let’s copy the output in Excel and Notepad. In the SSMS output, we see all text in a single line:
