我正在尝试在SQL Server的SSIS包中执行批量插入任务,但是在尝试打开文件或尝试查找文件时显示错误。在网上搜索错误可能是:
路径不正确:不是这个,我尝试过普通路径和UNC路径,如果我在资源管理器中复制路径,它会打开文件。
BD用户没有权限:执行任务的用户是我的用户,他具有管理员权限,而DB用户是BulkAdmin和SysAdmin。
UNC路径的错误是:
SSIS package "BulkInsert.dtsx" starting.
Error: 0xC002F304 at Bulk Insert Task, Bulk Insert Task: An error occurred with the following error message: "Could not bulk insert because file '\\MyMachine\D$\Pro\Pro Mig\Mig\Filess\XXXXXXX130309.TXT' could not be opened. Operating system error code 53(The network path was not found.).".
Task failed: Bulk Insert Task
SSIS package "BulkInsert.dtsx" finished: Success.
正常路径的错误是:
SSIS package "BulkInsert.dtsx" starting.
Error: 0xC002F304 at Bulk Insert Task, Bulk Insert Task: An error occurred with the following error message: "Could not bulk insert because file 'D:\Pro\Pro Mig\Mig\Filess\XXXXXXX130309.TXT' could not be opened. Operating system error code 3(The system cannot find the path specified.).".
Task failed: Bulk Insert Task
SSIS package "BulkInsert.dtsx" finished: Success.
感谢您的帮助。
答案 0 :(得分:3)
要使用SSIS 2008批量插入任务,源文件必须与目标数据库位于同一服务器上。如果在源文件位于远程服务器上时尝试使用“任务”,则会出现这些错误。