SSMS结果到网格 - CRLF没有保存在复制/粘贴 - 任何更好的技术? [英] SSMS Results to Grid - CRLF not preserved in copy/paste - any better techniques?

查看:177
本文介绍了SSMS结果到网格 - CRLF没有保存在复制/粘贴 - 任何更好的技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  SELECT'line 1 
line 2
line 3'



<$ p (13)+ CHAR(10)+'line 2'+ CHAR(13)+ CHAR(10)+'line 3'
SELECT'line 1' code


$ b

使用嵌入式CRLF,网格中的显示看起来用空格替换(我想这样他们将显示所有的数据) 。

问题是,如果我是代码生成脚本,我不能简单地剪切和粘贴这个。我必须转换代码来打开游标并打印相关的列,以便我们可以从文本结果中复制和粘贴它们。

有没有更简单的解决方法可以保留CRLF在从结果网格复制/粘贴操作?

网格的有用的原因是,我目前正在生成一些脚本为同一个对象在不同的列 - 在一列中的bcp,在另一列中的xml格式文件,在另一个列表中创建脚本等等。

解决方案

我相信这篇文章有几个有用的技巧: http://sqlblogcasts.com/blogs/martinbell/archive/2009/10/25/How-to-display-long-text-in-SSMS.aspx a>


When I have a result set in the grid like:

SELECT 'line 1
line 2
line 3'

or

SELECT 'line 1' + CHAR(13) + CHAR(10) + 'line 2' + CHAR(13) + CHAR(10) + 'line 3'

With embedded CRLF, the display in the grid appears to replace them with spaces (I guess so that they will display all the data).

The problem is that if I am code-generating a script, I cannot simply cut and paste this. I have to convert the code to open a cursor and print the relevant columns so that I can copy and paste them from the text results.

Is there any simpler workaround to preserve the CRLF in a copy/paste operation from the results grid?

The reason that the grid is helpful is that I am currently generating a number of scripts for the same object in different columns - a bcp out in one column, an xml format file in another, a table create script in another, etc...

解决方案

I believe this article has several techniques which can be useful: http://sqlblogcasts.com/blogs/martinbell/archive/2009/10/25/How-to-display-long-text-in-SSMS.aspx

这篇关于SSMS结果到网格 - CRLF没有保存在复制/粘贴 - 任何更好的技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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