SSIS:For Each File 枚举器为空

SSIS: The For Each File enumerator is empty

我创建的包在 Visual studio 中运行良好。
该包使用 for each file 循环,变量指向这样的文件夹:

C:\Users\Desktop\Folder\

然而,一旦我在 SSMS 上部署包,当我执行包时,我收到以下错误:

Foreach File in Folder:Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty

为什么我在 SSMS 中收到此警告,但在 VS 中运行正常?

注意:SQL 服务器未托管在我的本地计算机上。

如果您使用文件夹的本地路径,就像这样

C:\Users\Desktop\Folder\

然后当您 运行 SQL 服务器上的包时,文件需要位于 SQL 服务器上的本地路径中。

当您 运行 在 Visual Studio 中时,它会在您机器上的本地路径中查找文件。