Click here to Skip to main content
15,881,424 members
Articles / Web Development / ASP.NET
Article

How to Schedule and Run a SSIS package ( DTS ) Job in SQL Server 2005

Rate me:
Please Sign up or sign in to vote.
3.97/5 (20 votes)
9 Jun 20062 min read 520.6K   59   33
How to Schedule and Run a SSIS package ( DTS ) Job in SQL Server 2005

Introduction

How to Schedule and Run a SSIS package ( DTS ) Job<o:p>

<o:p> 

In the SQL Server 2005, after you create a SSIS package ( DTS), you want to create a job and schedule to run it. You will get the error to prevent you to run the job. What is the problem?

<o:p> 

Here is why: SQL Server 2005 is quite different from SQL Server 2000. In SQL Server 2000, you can create the job and run it without problem. In SQL Server 2005, you need to go through the security layer in order to run the job.

<o:p> 

The logic is like this:

Ø      The job executor account needs the roles of sysadmin,  SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole

Ø      The job needs to be run under Proxy account

Ø      The job executor account is better to be used to create SSIS package and so you are sure the job executor account has the right to run this SSIS package.

<o:p> 

The following steps can be followed to get the job done.

The work environment is MS SQL Server Management Studio and you log in as sa.

<o:p> 

I. Create job executor account<o:p>

Highlight Security->New Login, say to make login as devlogin, type your password, default database can be your target database.

Server roles: check “sysadmin

User mapping: your target database

Msdb database: you make sure to include SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole <o:p>

Then click OK

<o:p> 

II. Create SQL proxy account and associate proxy account with job executor account<o:p>

Here is the code and run it the query window.

<o:p> 

Use master

CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'

Use msdb

Sp_add_proxy @proxy_name='MyProxy', @credential_name='MyCredential'

Sp_grant_login_to_proxy @login_name=' devlogin', @proxy_name='MyProxy'

Sp_grant_proxy_to_subsystem @proxy_name='MyProxy', @subsystem_name='SSIS'

<o:p> 

III. Create SSIS package<o:p>

In MS SQL Server Business Intelligence Development Studio, you use job executor account devlogin to create the SSIS package (DTS) and make sure you can execute this package in SQL Server Business Intelligence Development Studio. Compile/build this package.

<o:p> 

IV. Create the job, schedule the job and run the job<o:p>

In SQL Server Management Studio, highlight SQL Server Agent -> Start. Highlight Job ->New Job…, name it , myJob.

Under Steps, New Step, name it, Step1,

Type: SQL Server Integration Service Package

Run as: myProxy

Package source: File System

Browse to select your package file xxx.dtsx

Click Ok

Schedule your job and enable it

<o:p> 

Now you can run your job.

<o:p> 

If you think this is very helpful, please leave your comments online. If you have any questions or suggestions, please email me at hong_wei_li@yahoo.com.

<o:p> 

Happy SQLing!

<o:p> 

- Hongwei Li

<o:p> 

<o:p> 

<o:p> 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
C# and .NET Core
Typescript, node.js, jQuery, jQuery Mobile
Web Api and MVC
Angular and AngularJS
Azure
Databases (SQL Server and Oracle) and No-SQL Databases
Agile and Waterfall

Comments and Discussions

 
QuestionPerfect! Pin
Member 368331728-May-14 13:29
Member 368331728-May-14 13:29 
QuestionThis just saved me from madness Pin
glynrb16-Jan-13 0:22
glynrb16-Jan-13 0:22 
GeneralMembers of sysadmin server role are allowed to use any proxy. Pin
Mohammed Raheem23-Jul-12 1:55
Mohammed Raheem23-Jul-12 1:55 
QuestionCreate SSIS with job executor, how? Pin
zhuangrich17-Jul-11 20:39
zhuangrich17-Jul-11 20:39 
GeneralThanks a lot - Muchas Gracias Pin
mazv14-Jan-11 8:23
mazv14-Jan-11 8:23 
GeneralWow... Thanks its works Pin
anakbinus17-Aug-09 17:40
anakbinus17-Aug-09 17:40 
GeneralGreat help! Pin
Omoba28-Apr-09 5:07
Omoba28-Apr-09 5:07 
Generalfaster extraction and loading on SSIS. Pin
blackpower2k725-Apr-09 19:54
blackpower2k725-Apr-09 19:54 
GeneralSSIS execution from SQL agent Pin
mmohsin20-Jan-09 6:40
mmohsin20-Jan-09 6:40 
QuestionDo I need a NT account for creating an credential? Pin
Chris sc Lee9-Dec-08 14:55
Chris sc Lee9-Dec-08 14:55 
GeneralSSIS OLE DB Source oracle proc call Pin
WTurcios27-Aug-08 9:49
WTurcios27-Aug-08 9:49 
Generalunable to cast Pin
superman10013-Aug-08 14:12
superman10013-Aug-08 14:12 
QuestionError code Error 15404 Pin
Member 382627511-Aug-08 8:34
Member 382627511-Aug-08 8:34 
AnswerRe: Error code Error 15404 Pin
Peter Brennen3-Jun-10 4:48
Peter Brennen3-Jun-10 4:48 
GeneralOMG Thank you so much Pin
anvie1-Aug-08 6:32
anvie1-Aug-08 6:32 
GeneralGreat working solution - I think there may be more though Pin
James Towell31-Jul-08 3:00
James Towell31-Jul-08 3:00 
GeneralDTS to SSIS conversion Pin
SayCode24-Jul-08 4:50
SayCode24-Jul-08 4:50 
GeneralRunning an SSIS package Pin
Stevie G22-May-08 1:02
Stevie G22-May-08 1:02 
GeneralGood Job Man! Pin
JonCR6-May-08 11:30
JonCR6-May-08 11:30 
QuestionHow do I resolve error after following Step 1? [modified] Pin
Paul Cho7-Feb-08 10:16
Paul Cho7-Feb-08 10:16 
AnswerRe: How do I resolve error after following Step 1? Pin
Paul Cho19-Feb-08 11:56
Paul Cho19-Feb-08 11:56 
GeneralGreat Pin
Cool_rajdevil12-Jul-07 3:40
Cool_rajdevil12-Jul-07 3:40 
GeneralI am not able to find the option: Package Source: File System. Pin
WadeDing29-May-07 7:23
WadeDing29-May-07 7:23 
GeneralRe: I am not able to find the option: Package Source: File System. Pin
hong_wei_li@yahoo.com29-May-07 18:40
hong_wei_li@yahoo.com29-May-07 18:40 
The Package Source: File System is close to the bottom of the user interface. Be patient. A lot of people used my article to get the job done! Have fun!
- Hongwei Li Smile | :)
GeneralRe: I am not able to find the option: Package Source: File System. Pin
WadeDing30-May-07 2:29
WadeDing30-May-07 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.