Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've got a SSIS package installed on a SQL server (SQL Server 2012). It's fairly simple and just fetches data from a remote data source and adds it into a local table. The remote connection string is using SQL server authentication, while the local connection is using Windows auth. The remote connection password is protected, and the package was imported setting the protection level to Rely on server storage and roles for access control.

If I run the SSIS package manually, it works. If I run it from the command line using dtexec, it works. If I use runas to switch to the domain account that the SQL server agent is running under, and then run the package using dtexec, it works. If I create a SQL Agent job with a single step to run the package, it fails, providing very little detail as to what's going on. I'm guessing it's not able to get the password to log into the remote SQL server, because it fails very quickly. Also, if I tick 'log to table' and view the resulting file, I get the following:

Description: ADO NET Source has failed to acquire the connection {0D8F2CD4-A763-4AEB-8B52-B8FAE0621ED3} with the following error message: "Login failed for user 'username'.".

If I try to add the password in the connection string manually under data sources in the job step dialog, it refuses to save it, always seeming to remove the 'password' bit of the connection string.

I thought that SQL server agent jobs always ran under the context of the account which the SQL server agent is running under. This account is a sysadmin on the local SQL server, and the package works using dtexec under that account, so why would it fail when trying to run as an agent job?

share|improve this question

2 Answers 2

I had this same issue. After some research and convincing the server I didn't have control over to add a Windows Authenticated account to there location and some insight from the below URL, I got it working:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/3f51de7b-52c2-471e-811b-d056f707f5bd/what-is-the-difference-between-job-owner-run-as-and-log-on-to-the-server-acounts-in?forum=sqlintegrationservices

Our environment is this:

SQL Server 2012 hosting Integration Services Catalog which is bringing together data from various SQL Server versions across a different domain.

Two domains: - Domain A and Domain B (they trust each other).

  • SSIS catalog in domain A, SQL Server Agent job running SSIS package on domain A.
  • SSIS package pulls data from databases on domain B using Windows Authentication connections setup in the SSIS package. The package runs fine.
  • One service account that belongs to Domain B has access to all the data sources in question.

This gave me an understanding of the difference in how they run for a SQL Server agent job. Given the fact that my SSIS package is reaching out to a remote server on a different domain and that my error was pertaining to the "Run As" user account in the step, I decided to create another "Run As" account. This is also known as a proxy (SQL Server Agent > Proxies > SSIS Package Execution).

Before creating the proxy, I had to setup a credential. Here the steps that solved this issue for me:

All steps assume your SSIS package is loaded into the Integration Services Catalog and the SQL Server agent job is created with a step to run the package from the SSIS Catalog (Package Source).

  1. Create a credential (Security > Credentials). Use the identity in the credential as the service account mentioned above.
  2. Create a SSIS package execution proxy (SQL Server Agent > Proxies > SSIS Package Execution). To help understand everything, I gave it the same name as the service account.
  3. Go to the SQL Server agent job and then the step. Change the run as from SQL Server Agent Service account to your newly created proxy account. Press OK and OK.
  4. Run the job to test.

This worked for our situation and allowed our SSIS package to run as scheduled and traverse across a domain to a different SQL Server box and pull data.

share|improve this answer

It's usually easier to get these working if you can just use Windows Authentication instead of SQL Authentication.

share|improve this answer
    
Unfortunately, I don't control the SQL server which it pulls data from, so SQL auth is my only option here. –  growse Apr 4 '12 at 9:57
    
Well that sucks. Never mind then. –  mrdenny Apr 5 '12 at 2:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.