With every new release some of the default behavior can surprise because you are so much used to them. But when they don’t behave the same, it baffles to when some of these changes were introduced. In pursuit of finding such behavior, while I was working with SQL Server 2016 Management Studio, I was surprised to see a behavior which didn’t seem to be right. You can also try it too.
Here is the query which would demonstrate the behavior.
SELECT 'Pinal Dave is an owner of SQLAuthority.com'
This command is in three line and there is a carriage return at the end of each line. Once we run above query in grid mode, we would see below in SQL Server 2014 Management Studio and SQL Server 2016 Management Studio.
Yes, you are right! There is no difference in output. Now, here is the fun part – Copy the results of the grid and paste it in any text editor: SSMS or Notepad or Word or anywhere you want.
Did you see the difference in behavior? Here it is in Notepad.
When we copy paste from SSMS 2016, it removed carriage return and complete text came in single line. I think that’s something which few people may not like. I searched further on documentation and found setting to change this behavior in SQL Server 2016 Management Studio. It didn’t take much time to find below setting (Can be reached by Tools > Options in SSMS menu bar)
By default, its unchecked and that why it’s not retaining CR/LF (carriage return / Line Feed). Once I checked the box, I was able to get earlier behavior. Do have such requirements in your system? Do let us know.
Reference: Pinal Dave (https://blog.sqlauthority.com)