DTExec找不到文件

我有一个包被创build,它被加载到我们的SQL服务器上。 该软件包进入一个文件夹,读取和excel,转储成表格,然后存档。

正常运行包(通过BIDS ),它工作得很好。

但是当我通过使用以下行SSMS运行它:

 exec master.dbo.xp_cmdshell 'C:\"Program Files (x86)"\"Microsoft SQL Server"\100\DTS\Binn\DTExec.exe /DTS "<package location>" /SERVER "<Server>" /CHECKPOINTING OFF /REPORTING V' 

拉取Excel名称的部分(对于程序包中的每个循环)报告它没有find任何东西。

  Description: 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. 

该软件包需要在32位模式下运行来读取excel,这就是我使用32位dtexec位置的原因。

任何人都知道这是怎么回事

在我看来,你应该使用create SSIS Type Job并更改:

 exec master.dbo.xp_cmdshell 'C:\"Program Files (x86)"\"Microsoft SQL Server"\100\DTS\Binn\DTExec.exe /DTS "<package location>" /SERVER "<Server>" /CHECKPOINTING OFF /REPORTING V' 

有:

 EXEC dbo.sp_start_job 'job_name'; 

我也会检查你执行cmd shell时使用的帐号。 我怀疑没有足够的权限来读取特定的目录或不同的环境variables。