Solved

SQL Server 2008 job fails when deleting records in Linked Server

Posted on 2014-03-10
3
759 Views
Last Modified: 2016-02-10
Hi all.

I have a SQL Server 2008 SSIS package that deletes records from a table in a Linked Server. The linked server (myServerB) is SQL Server 2000.

When I run the package from Integration Services it completes with no errors and deletes the records from the table on the linked server. But when I create a new job from SQL Server Agent and then click on "Start Job at Step..." it fails with the following error:

Executed as user: DOMAIN\ServerName$. Code: 0xC002F210

Delete permission denied on object 'table', database 'mydb', owner 'dbo'. Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).

I know the sql task works because when I run the package from Integration Services it completes successfully and deletes the records from the table, but when I try to execute the package from jobs in SQL Server Agent it fails. I have the owner as DOMAIN\administrator, why is it executing as DOMAIN\ServerName$?

How can I get the job to run the package successfully?

Thank you in advance.
0
Comment
Question by:printmedia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39917884
>I know the sql task works
this is due to the difference that when you RUN the package from SSIS interactively, the run takes YOUR credentials;
while when the package is run in a JOB, sql server takes the credentials of the sql server agent, by default.

you can specify the "Run AS" in the sql server job's step to solve this for just this task, or to change the sql server agent's default startup login to a login that will have the permissions as needed.
0
 

Author Comment

by:printmedia
ID: 39917914
Thank you for your reply.

I'm in the Job Step but it does not let me choose a "Run As" user it defaults to: "SQL Server Agent Service Account".
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39917918
then you need to create some "sql agent proxy" first:
http://technet.microsoft.com/en-us/library/ms189064%28v=sql.105%29.aspx
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question