I'm thinking that this is pretty easy to do. Say I have the following query:

我觉得这很容易做到。说我有以下查询:

select QUOTENAME(countNumber as [Count Number],'"'), QUOTENAME(testValue,'"') as [Test Value] from tblTestResults

I get my results surrounded by double quotes - good. But now when I choose "Save as", not only do I want the headers, but I want them surrounded by double quotes as well in my resulting csv file. I saw (from another stackoverflow question) that there should be an option to select headers in Tools > Query Results. But I don't seem to have that in mine. Thoughts?

我的结果被双引号括起来 - 很好。但是现在当我选择“另存为”时,我不仅需要标题,而且还希望它们在我生成的csv文件中被双引号括起来。我看到(来自另一个stackoverflow问题)应该有一个选项来选择工具>查询结果中的标题。但我似乎没有那个。思考?

Also, I'm using Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)

此外,我正在使用Microsoft SQL Server 2008(SP1) - 10.0.2531.0(X64)

2 个解决方案

#1


3

SELECT TOP (1) QUOTENAME(name, '"') AS ["Name"]
FROM sys.objects ORDER BY [object_id];

Yields this:

"Name"
"sysrscols"

If you click in the top-left corner of the grid output (so all rows are selected), you can right-click and select "Copy with Headers" ... this will copy the headers with the quotes as per above.

如果单击网格输出的左上角(以便选择所有行),则可以右键单击并选择“使用标题复制”...这将使用上面的引号复制标题。

Query > Results to File should show these headers with double quotes as well (but not Save Results As for some reason - it doesn't include the headers).

查询>结果到文件也应显示带有双引号的这些标题(但不保存结果由于某种原因 - 它不包括标题)。

更多相关文章

  1. TextView在单击时发送电子邮件
  2. 如何在android地图中使用TextWatcher显示带标题的搜索标记并隐藏
  3. Android全屏显示,去除标题栏和状态栏
  4. 单击按钮后更改Frame的内容窗格

随机推荐

  1. Android集成友盟集成推送方案调研
  2. android/NDK开发assets资源中文名打包问
  3. android 学习(2)对话框
  4. android 圆角按钮和按钮颜色
  5. Android 中文 API (93) —— BaseExpandabl
  6. android中实现带图片和checkbox的listvie
  7. Android的快速开发框架afinal
  8. Myeclispe10+ Android4.4 环境搭建
  9. Android系统对应用程序权限申请的处理方
  10. android-apktool - A tool for reverse e