Microsoft .NET Framework未处理的异常

时间:2016-02-24 19:11:23

标签: sql-server

我正在使用SQL Server 2008将查询的输出(大量数据)复制到Excel电子表格中。我一直得到下面的Microsoft“未处理的异常”然后SQL Server 2008退出然后我将不得不重新开始一切:

jitDebugging is already enabled in my machine (Windows 7)

Microsoft .NET Framework Unhanded exception

Microsoft.SqlServer.Types
    Assembly Version: 10.0.0.0
    Win32 Version: 2009.0100.2500.00 ((KJ_PCU_Main).110617-0026 )
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.Types/10.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.Types.dll
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

--------------------------------------------------------------

非常感谢任何帮助

1 个答案:

答案 0 :(得分:0)

我感到痛苦。

我遇到过从SSMS的Gridview复制结果的问题 - &gt; Excel中。我遇到的那个与一个包含“(引用)的字段相关 - 它导致数据没有显示在Excel中!我将其作为错误提交但从未得到回复:

https://connect.microsoft.com/SQLServer/feedback/details/828677/ssms-copy-and-paste-into-excel-when-data-contains-a-double-quote-character

这不是将结果从SSMS粘贴到Excel中的唯一问题:

https://connect.microsoft.com/SQLServer/SearchResults.aspx?SearchQuery=excel%20paste

我的建议是:

  1. 将结果输出到文本文件,然后导入Excel。很好,因为Excel无论如何都不喜欢“大量数据”。不好,因为它只是一个纯文本文件,而您的用户想要Excel。

  2. 如果这是您经常需要运行的单个报告,则可以将其另存为逗号/制表符分隔文件,以更改SELECT语句。当您从Excel中打开它时,将指导您的用户通过向导导入它。这是一种黑客行为:

  3. SELECT ISNULL(FIELD1) + CHAR(9) + ISNULL(FIELD2) + CHAR(9) + ISNULL(FIELD3)

    1. 使用bcp.exe导出数据,但是如果要打命令行:

    2. 创建PowerShell脚本。我在SSMS中构建我的查询然后将查询(而不是结果)复制到剪贴板并运行我的PS命令。 PS脚本获取剪贴板并通过ADO.NET将其提交给SQL。 PS可以轻松地将内容保存到磁盘上作为逗号分隔的列表,或者您可以像这样使用硬核Excel(如果通过电子邮件发送它会增加奖励):

    3. https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Export-SQL-Data-67bcb690