Execute SQL Job with Proxy

AID: 8452
  • Status: Published

2500 points

  • ByPatelAlpesh
  • TypeTutorial
  • Posted on2011-10-31 at 06:08:03
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful.

Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem when you have created an SSIS package that is running perfectly with BIDS, however, when you execute using SQL Job, it fails. Why does this error happen? It’s probably because you are accessing a directory or directories which do not have the correct permissions for SQL Agent User then SQL Agent (SQL Job) through exception.

To solve this problem you need to create a proxy and execute SQL Job using the Proxy User. Let's go through this step by step below:

1. A Proxy credential needs to be created first. Look at the image below to see how to create a credential using the existing Windows user.

Like this: Server => Security => Credential=> New Credential

 
Proxy-1.png
  • 23 KB
  • Step 1.1
Step 1.1




Create Credential using the Windows user. To do that, click on the button beside “Identity” and select Windows user for whom you have assign the folder (Directory) permissions. Create the password and hit OK.

 
Proxy-1-1.png
  • 114 KB
  • Step 1.2
Step 1.2



2. Next, let's give permissions to Windows User for the particular folder using the SSIS package.

Right Click on Folder => Properties=> Security Tab

 
Proxy-1-2.png
  • 143 KB
  • Step 2
Step 2



Assign permissions as shown in image above and click OK until all dialog boxes are closed.

3. Now it’s time to create Proxy.

Click on SQL Server Agent => Proxies => SSIS Packages => New Proxies

 
Proxy-2.png
  • 19 KB
  • Step 3.1
Step 3.1


This opens a new dialog box as seen below:

 
Proxy-2-1.png
  • 134 KB
  • Step 3.2
Step 3.2


Select sub system (SSIS Packages) and existing (Just created) Credential as shown in image above and close the dialog boxes.

4. Let’s use the Proxy in SQL Job

 
Proxy-3.png
  • 168 KB
  • Step 4
Step 4


Create the SQL Job as usual: Right click on Jobs folder under SQL Server Agent => Create Job

Select Proxy instead SQL Server Agent user as shown in above image.



I hope, you will find this article helpful.



Thanks,

Alpesh
    Asked On
    2011-10-31 at 06:08:03ID8452
    Tags

    SQL Server

    ,

    SQL Server Agent

    ,

    SSIS

    Topic

    MS SQL Server

    Views
    1789

    Comments

    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top MS SQL Server Experts

    1. jogos

      246,566

      Guru

      1,668 points yesterday

      Profile
      Rank: Sage
    2. acperkins

      246,249

      Guru

      1,000 points yesterday

      Profile
      Rank: Genius
    3. lcohan

      194,990

      Guru

      2,000 points yesterday

      Profile
      Rank: Genius
    4. anujnb

      179,525

      Guru

      2,000 points yesterday

      Profile
      Rank: Wizard
    5. ScottPletcher

      154,405

      Guru

      6,500 points yesterday

      Profile
      Rank: Genius
    6. matthewspatrick

      131,392

      Master

      1,620 points yesterday

      Profile
      Rank: Savant
    7. ValentinoV

      126,429

      Master

      1,800 points yesterday

      Profile
      Rank: Genius
    8. EugeneZ

      120,790

      Master

      2,000 points yesterday

      Profile
      Rank: Genius
    9. TempDBA

      112,141

      Master

      1,168 points yesterday

      Profile
      Rank: Sage
    10. angelIII

      100,133

      Master

      0 points yesterday

      Profile
      Rank: Elite
    11. HainKurt

      93,046

      Master

      0 points yesterday

      Profile
      Rank: Genius
    12. mwvisa1

      88,585

      Master

      40 points yesterday

      Profile
      Rank: Genius
    13. dtodd

      88,114

      Master

      0 points yesterday

      Profile
      Rank: Genius
    14. huslayer

      81,392

      Master

      0 points yesterday

      Profile
      Rank: Sage
    15. ralmada

      75,583

      Master

      400 points yesterday

      Profile
      Rank: Genius
    16. BCUNNEY

      74,206

      Master

      0 points yesterday

      Profile
      Rank: Guru
    17. dqmq

      66,272

      Master

      0 points yesterday

      Profile
      Rank: Genius
    18. rajeevnandanmishra

      60,246

      Master

      2,000 points yesterday

      Profile
      Rank: Guru
    19. dbaduck

      58,208

      Master

      2,000 points yesterday

      Profile
      Rank: Sage
    20. CodeCruiser

      55,120

      Master

      0 points yesterday

      Profile
      Rank: Genius
    21. Qlemo

      53,598

      Master

      2,000 points yesterday

      Profile
      Rank: Genius
    22. ryanmccauley

      52,252

      Master

      0 points yesterday

      Profile
      Rank: Sage
    23. Cluskitt

      50,880

      Master

      800 points yesterday

      Profile
      Rank: Wizard
    24. sdstuber

      50,836

      Master

      0 points yesterday

      Profile
      Rank: Genius
    25. mark_wills

      49,374

      10 points yesterday

      Profile
      Rank: Genius

    Hall Of Fame