Click here to Skip to main content
6,597,576 members and growing! (20,979 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate

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

By hong_wei_li@yahoo.com

How to Schedule and Run a SSIS package ( DTS ) Job in SQL Server 2005
SQL, .NET, WinXP, ASP.NET, Visual Studio, SQL 2005, Architect, DBA, Dev
Posted:9 Jun 2006
Views:162,756
Bookmarked:34 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
18 votes for this article.
Popularity: 4.75 Rating: 3.79 out of 5
1 vote, 5.6%
1
1 vote, 5.6%
2
4 votes, 22.2%
3
4 votes, 22.2%
4
8 votes, 44.4%
5

Introduction

How to Schedule and Run a SSIS package ( DTS ) Job

 

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?

 

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.

 

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.

 

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.

 

I. Create job executor account

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

Then click OK

 

II. Create SQL proxy account and associate proxy account with job executor account

Here is the code and run it the query window.

 

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'

 

III. Create SSIS package

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.

 

IV. Create the job, schedule the job and run the job

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

 

Now you can run your job.

 

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.

 

Happy SQLing!

 

- Hongwei Li

 

 

 

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

About the Author

hong_wei_li@yahoo.com


Member
.Focus on database (SQL Server 2005/2000/7/6.5 and Oracle 10g) development with C#,

ASP.NET, ASP, Java, PHP.
.Like to work with MS Server 2005 SSIS and report service
.Like full cycle software design, development and deployment
.Microsoft Certified SQL Server Developer and DBA.
Occupation: Web Developer
Location: United States United States

Other popular ASP.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 27 (Total in Forum: 27) (Refresh)FirstPrevNext
GeneralWow... Thanks its works Pinmemberanakbinus18:40 17 Aug '09  
GeneralGreat help! PinmemberOmoba6:07 28 Apr '09  
Generalfaster extraction and loading on SSIS. Pinmemberblackpower2k720:54 25 Apr '09  
GeneralSSIS execution from SQL agent Pinmembermmohsin7:40 20 Jan '09  
GeneralDo I need a NT account for creating an credential? PinmemberChris sc Lee15:55 9 Dec '08  
GeneralSSIS OLE DB Source oracle proc call PinmemberWTurcios10:49 27 Aug '08  
Generalunable to cast Pinmembersuperman10015:12 13 Aug '08  
QuestionError code Error 15404 PinmemberMember 38262759:34 11 Aug '08  
GeneralOMG Thank you so much Pinmemberanvie7:32 1 Aug '08  
GeneralGreat working solution - I think there may be more though PinmemberJames Towell4:00 31 Jul '08  
GeneralDTS to SSIS conversion PinmemberSayCode5:50 24 Jul '08  
GeneralRunning an SSIS package PinmemberStevie G2:02 22 May '08  
GeneralGood Job Man! PinmemberJonCR12:30 6 May '08  
GeneralHow do I resolve error after following Step 1? [modified] PinmemberPaul Cho11:16 7 Feb '08  
AnswerRe: How do I resolve error after following Step 1? PinmemberPaul Cho12:56 19 Feb '08  
GeneralGreat PinmemberCool_rajdevil4:40 12 Jul '07  
GeneralI am not able to find the option: Package Source: File System. PinmemberWadeDing8:23 29 May '07  
GeneralRe: I am not able to find the option: Package Source: File System. Pinmemberhong_wei_li@yahoo.com19:40 29 May '07  
GeneralRe: I am not able to find the option: Package Source: File System. PinmemberWadeDing3:29 30 May '07  
GeneralRe: I am not able to find the option: Package Source: File System. PinmemberWadeDing6:34 30 May '07  
QuestionSQL Server Integration Service Package Type [modified] PinmemberAunty B5:46 13 Feb '07  
AnswerRe: SQL Server Integration Service Package Type PinmemberAunty B6:25 13 Feb '07  
GeneralVerify SSIS Account Pinmemberjlminer11:41 5 Jan '07  
GeneralMicrosoft - An SSIS package does not run when you call the SSIS package from a SQL Server Agent job step Pinmembercoby cai18:21 26 Sep '06  
GeneralA Tip Pinmembercoby cai18:18 26 Sep '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Jun 2006
Editor:
Copyright 2006 by hong_wei_li@yahoo.com
Everything else Copyright © CodeProject, 1999-2009
Web21 | Advertise on the Code Project