如何将sql查询结果保存到excel?

时间:2022-11-05 09:31:55

How to save the sql query result from SQL Server 2008 R2 to Microsoft Excel 2008?

如何将SQL Server 2008 R2的SQL查询结果保存到Microsoft Excel 2008?

1 个解决方案

#1


9  

The manual way, if your in SQL Server Management Studio (SSMS), is to just highlight the rows and columns and paste it in Excel or you can right-click and save as a CSV file and open it in Excel.

手动方式,如果您在SQL Server Management Studio(SSMS)中,只需突出显示行和列并将其粘贴到Excel中,您可以右键单击并另存为CSV文件并在Excel中打开它。

To bring over the headers, you want to:

要引入标题,您需要:

  1. Click on the Tools menu option.
  2. 单击“工具”菜单选项。
  3. Click on Options -> Query Results -> Sql Server -> Results to Grid
  4. 单击选项 - >查询结果 - > Sql Server - >结果到网格
  5. Tick Include Column Headers when Copying or Saving the Results
  6. 复制或保存结果时勾选包含列标题

Then do your copy and paste.

然后进行复制和粘贴。

#1


9  

The manual way, if your in SQL Server Management Studio (SSMS), is to just highlight the rows and columns and paste it in Excel or you can right-click and save as a CSV file and open it in Excel.

手动方式,如果您在SQL Server Management Studio(SSMS)中,只需突出显示行和列并将其粘贴到Excel中,您可以右键单击并另存为CSV文件并在Excel中打开它。

To bring over the headers, you want to:

要引入标题,您需要:

  1. Click on the Tools menu option.
  2. 单击“工具”菜单选项。
  3. Click on Options -> Query Results -> Sql Server -> Results to Grid
  4. 单击选项 - >查询结果 - > Sql Server - >结果到网格
  5. Tick Include Column Headers when Copying or Saving the Results
  6. 复制或保存结果时勾选包含列标题

Then do your copy and paste.

然后进行复制和粘贴。