【发布时间】:2013-04-22 16:13:52
【问题描述】:
我正在尝试在 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.
感谢您的帮助。
【问题讨论】:
-
您是在 SQL 代理中运行它还是在 BIDS 中交互运行?听起来您是在不同的服务器上远程运行它并期望路径相同。
-
我尝试了两种不同的方法,在 BIDS 中和使用 dtexec 的 bat 文件
-
带有 DTExec 的 BAT 文件 - 您是在本地运行的还是在 SQL 代理中运行的?如果我们专注于在 BIDS 中运行它:那肯定应该在您的安全上下文下本地运行它,这意味着如果您可以看到该路径,您的 SSIS 包应该能够看到它。如果您键入 Start / Run 并在运行框中键入该路径会发生什么,它会找到它吗?
-
我在本地执行 bat,如果我将过去复制到 Run 中,它会打开带有 UNC 路径和正常路径的文件。
-
奇怪。我只能建议您使用 procmon 来监视您的进程并确保它按照您的想法运行,并执行您期望的操作。这是一个非常方便的工具。
标签: sql-server sql-server-2008 ssis bulkinsert