如何将 SQL Server 2005 行导出到 Excel?每次我这样做都会出错
我有 SQL Server 2005,我正在尝试将表导出到 Excel 文件中。
我右键单击我的数据库并单击导出。我通过向导并选择导出到 Excel,然后选择要导出的一张表并完成。
我明白了
消息
错误 0xc0202009:数据流任务:SSIS 错误代码 DTS_E_OLEDBERROR。发生 OLE DB 错误。错误代码:0x00040EDA。
(SQL Server 导入和导出向导)错误 0xc0209029:数据流任务: SSIS错误代码 DTS_E_INDUCEDTRANSFORMFAILUREONERROR。 “输入“目的地输入”(72)” 失败,因为错误代码 0xC020907B 发生了,并且错误行 对“输入”目的地的处置 输入“(72)”指定失败 错误。发生错误 指定的指定对象 成分。可能有错误 在此之前发布的消息有更多 有关失败的信息。 (SQL 服务器导入和导出向导)
错误 0xc0047022:数据流任务:SSIS 错误代码 DTS_E_PROCESSINPUTFAILED。 组件上的 ProcessInput 方法 “目的地-学校用户”(61) 失败,错误代码 0xC0209029。这 识别的组件返回错误 来自 ProcessInput 方法。这 错误特定于组件, 但该错误是致命的,会导致 数据流任务停止运行。 可能会发布错误消息 在此之前提供更多信息 关于失败。 (SQL 服务器 导入和导出向导)
错误 0xc0047021:数据流任务:SSIS 错误 代码 DTS_E_THREADFAILED。线 “WorkThread0”已退出并出现错误 代码 0xC0209029。可能有错误 在此之前发布的消息有更多 有关线程为何存在的信息 退出。 (SQL Server导入和导出向导)
好像导出一行然后就死掉了。我不知道为什么。
I have SQL Server 2005 and I am trying to export a table into an Excel file.
I right click on my database and click export. I go through the wizard and choose to export to excel then I choose my one table that I want to export and hit finished.
I get this
Messages
Error 0xc0202009: Data Flow Task: SSIS Error Code
DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x00040EDA.
(SQL Server Import and Export Wizard)Error 0xc0209029: Data Flow Task:
SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR.
The "input "Destination Input" (72)"
failed because error code 0xC020907B
occurred, and the error row
disposition on "input "Destination
Input" (72)" specifies failure on
error. An error occurred on the
specified object of the specified
component. There may be error
messages posted before this with more
information about the failure. (SQL
Server Import and Export Wizard)Error 0xc0047022: Data Flow Task: SSIS
Error Code DTS_E_PROCESSINPUTFAILED.
The ProcessInput method on component
"Destination - SchoolUsers" (61)
failed with error code 0xC0209029. The
identified component returned an error
from the ProcessInput method. The
error is specific to the component,
but the error is fatal and will cause
the Data Flow task to stop running.
There may be error messages posted
before this with more information
about the failure. (SQL Server
Import and Export Wizard)Error 0xc0047021: Data Flow Task: SSIS Error
Code DTS_E_THREADFAILED. Thread
"WorkThread0" has exited with error
code 0xC0209029. There may be error
messages posted before this with more
information on why the thread has
exited. (SQL Server Import and Export Wizard)
It seems to export one row and then it dies. I don't know why.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据我的经验,这类问题几乎总是与数据类型转换有关。单击页面上的“编辑映射...”按钮,您可以在其中选择源表并查看目标列的数据类型。
In my experience, these kinds of issues are almost always related to data type conversion. Click on the "Edit Mappings..." button on the page where you select your source table and review the datatypes for the destination columns.
我将导出到 csv,然后在 Excel 中打开该 csv。对我有用。每当我尝试通过向导和 SSIS 在 Excel 和 SQL Server 2005 之间直接移动数据时,我经常遇到错误。我不再这样做了。
I would export to csv, and then open that csv in Excel. Works for me. Whenever I tried to move data directly between Excel and SQL Server 2005 via wizards and SSIS, I was frequently encountering bugs. I don't do it anymore.
正如 Joe 提到的,Excel 2003 - 2007 的字符数限制为 32767 个。 检查可疑列中数据的长度
我建议使用此命令select * from yourtable
其中 len(yourcolumn) > 32767
您将获得长度超过所需限制的所有行的列表。从此表中删除这些行,然后尝试导出。它应该工作正常。
Excel 2003 - 2007 has a limit of 32767 characters as mentioned by Joe. I suggest to check the length of your data in your suspicious column using this command
select * from yourtable
where len(yourcolumn) > 32767
You will get the list of all rows in which the length exceeds the required limit. Remove these rows from this table and then try to export. It should work fine.