我创建了一个 SSIS 包,该包删除然后创建一个表,以将数据从 Sql Server 2008 r2 传输到访问文件。当我在 BIDS 2008r2 中运行它时,它运行得很好,完全没有截断问题。当我获取该包并在 SQL Server 代理上运行它时,它无法说它在日期字段上有截断错误。当我手动查看数据(只有 159 条记录)时,我看不到任何时髦的数据。
我的帐户和服务帐户都是服务器管理员,因此服务器端的访问权限没有区别,而且我们都在目标文件共享的本地管理员组中。我还运行了 4 个以相同方式构建的其他软件包,但这是唯一一个仅在代理上出现数据截断错误的软件包,而不是在投标中手动运行。
以下是错误的全文减去用户帐户信息。
Executed as user:<Domain>\<sql service account>. Microsoft (R) SQL Server Execute Package Utility Version 10.50.6560.0 for 64-bit Copyright (C) Microsoft Corporation 2010. All rights reserved.
Started: 7:13:49 AM
Error: 2019-08-12 07:13:50.78
Code: 0xC0202009
Source: Data Flow Task 1 chips dest [705]
Description: SSIS Error Code DTS_E_OLEDBERROR.
An OLE DB error has occurred. Error code: 0x00040EDA.
End Error
Error: 2019-08-12 07:13:50.78
Code: 0xC020901C
Source: Data Flow Task 1 chips dest [705]
Description: There was an error with input column "DATE" (959) on input "Destination Input" (718). The column status returned was: "The value could not be converted because of a potential loss of data.".
End Error
Error: 2019-08-12 07:13:50.78
Code: 0xC0209029
Source: Data Flow Task 1 chips dest [705]
Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.
The "input "Destination Input" (718)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "Destination Input" (718)" 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.
End Error
Error: 2019-08-12 07:13:50.78
Code: 0xC0047022
Source: Data Flow Task 1 SSIS.Pipeline
Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED.
The ProcessInput method on component "chips dest" (705) failed with error code 0xC0209029 while processing input "Destination Input" (718). 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.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 7:13:49 AM
Finished: 7:13:53 AM
Elapsed: 4.197 seconds.
The package execution failed.
The step failed.
这是令人讨厌的不一致之一,因为 SQL 代理可能在与您自己运行时不同的设置下运行(例如,
ARITHABORT
当您打开它时它可能会关闭,等等)。我发现使用对不同设置不敏感的解决方案更稳健,而不是摆弄设置,这意味着避免任何可能的精度损失。因为您的目标是 Access 数据库,所以日期/时间的精度为一秒。如果您使用的是旧
datetime
数据类型,它具有 1/3 毫秒的奇怪精度,这可能会导致 SSIS 喜欢告诉所有人和他们的狗的精度损失。要解决此问题,请通过使用
datetime2(0)
具有相同精度(一秒)的精度来精确匹配精度,这应该避免错误,无论您/代理在什么设置下运行。