Running SSIS package as SQL Job doesn't process any files.

I created an SSIS package to import text files from a folder into a database. I runs fine when execute it in Visual Studio and when i double-click the .dtsx file.

But when I have it as a SQL Job, it runs does not work properly.  The SQL Job executes fine and it sends me an email (an SSIS task in the package) but nothing is actually done and my package metrics reports 0 files were iterated.  I have tried setting the SQL agent to run as the same user (me) and it doesn't seem to make a difference.

What is different is that the SSIS variables that I used (to help iterate through the data files folder) do not appear on the email (NULL?) that gets sent when I run it through the SQL Job.  Although they appear fine in the email when the SSIS runs fine (using the other methods).

There is a little extra complexity because the database runs on a SQL 2008 R2 instance, but I created the package in vs2012.  I got errors trying to run it on that instance, so I was trying to run it from my local machine which runs SQL 2012. 
But even moving a copy of the database to my local instance (and repointing the db connection manager) is the same thing.  The package works when I run it through VS or the .dtsx, but it doesn't work as a SQL job.

Any suggestions on where to look next?

August 21st, 2015 6:27pm

I thought I had it...
I was using a mapped drive to reference the data folder, and I thought that was the issue. 

https://social.technet.microsoft.com/Forums/en-US/13aecd7c-c4a4-4c8d-b9f5-20f517f97bcd/ssis-package-runs-ok-manually-but-not-from-sql-server-agentpermissions?forum=sqlintegrationservices

But after switching to a full  UNC, it is still a problem, sigh.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 7:01pm

Oops, that was it!  There was another place where I was using a mapped drive.  Once I fixed that, the package worked from the SQL job.

This was the answer:
https://social.technet.microsoft.com/Forums/en-US/13aecd7c-c4a4-4c8d-b9f5-20f517f97bcd/ssis-package-runs-ok-manually-but-not-from-sql-server-agentpermissions?forum=sqlintegrationservices

Specifically, I was referencing the data file folder using a mapped drive notation.  I had to change all references to this folder to a UNC

August 21st, 2015 7:14pm

Hi TIA,

Glad to heard that the issue had been solved and thanks for your sharing. It will be very beneficial for other community members who have similar questions.

Regards,
Katherine Xiong

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2015 9:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics