Click here to Skip to main content
Click here to Skip to main content

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

By , 9 Jun 2006
 

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
Web Developer
United States United States
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.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionThis just saved me from madnessmemberglynrb16 Jan '13 - 0:22 
I'd been struggling to get an SSIS package to run in a very complex environment. In the end I decided to act stupid and simply follow these instructions. It works (yes there is the message about sysadmins), and as long as you don't stupidly add a space before the name of your login (well I did say that I had decided to act stupid) it works first time.
 
Thank so much.
 
Glyn
GeneralMembers of sysadmin server role are allowed to use any proxy.memberMohammed Raheem23 Jul '12 - 1:55 
'devlogin' is a member of sysadmin server role and cannot be granted to or revoked from the proxy. Members of sysadmin server role are allowed to use any proxy.
 
sfdsfsdfsd
QuestionCreate SSIS with job executor, how?memberzhuangrich17 Jul '11 - 20:39 
Hi
 
Your info is very useful and serve a good guidance...it is precise and concise. Thank you for your article.
 
I have a query, from your article:
 
"In MS SQL Server Business Intelligence Development Studio, you use job executor account devlogin to create the SSIS package..."
 
When I open my BIDS, there is no User & Password prompt for me to enter. I can create new SSIS directly. Hence, how do I ensure I use my job executor account to create SSIS package?
 
Regards,
Rich
GeneralThanks a lot - Muchas GraciasmemberMember 358032614 Jan '11 - 8:23 
IT works...thank you
 
Muchas Gracias.
GeneralWow... Thanks its worksmemberanakbinus17 Aug '09 - 17:40 
Thanks A lot Mr. Hong, now i can run shedule ssis package
GeneralGreat help!memberOmoba28 Apr '09 - 5:07 
thanks a lot, your article really helped me with scheduling my SSIS package. Thumbs Up | :thumbsup:
 
Is life easier, with or without technology?

Generalfaster extraction and loading on SSIS.memberblackpower2k725 Apr '09 - 19:54 
hi...
check out the below link for getting some tips over faster extraction and loading on SSIS.
 
http://www.sqllion.com/
 
You will know me better sooner...

GeneralSSIS execution from SQL agentmembermmohsin20 Jan '09 - 6:40 
Hi,
 
The article very precise and a good one. I am trying to implement the same on my servers and I have two issues here,
 
1) I created all my packages in my local servers and now I have to move these to dev, UAT and prod servers where I do not have the username under which these packages were created.
- How to convert the package creator name to a executor name?
2) When I running the package, the job start but it never calls the SSIS itself. In the sense the job monitor shows that it is running but but won't trigger the package at all.
 
Please advice.
 
Thanks,
-Mohsin
QuestionDo I need a NT account for creating an credential?memberChris sc Lee9 Dec '08 - 14:55 
Hi,
 
In step 2:
II. Create SQL proxy account and associate proxy account with job executor account
 
CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'
 
So does it mean I need a Windows account before creating a credential? Thanks.
 
Chris
GeneralSSIS OLE DB Source oracle proc callmemberWTurcios27 Aug '08 - 9:49 
hong wei li,
I am designing an SSIS package with Data Flow that will call an oracle proc.
 
Currently on my Data flow i have the following:
 
* OLE DB Source - using Microsoft OLE DB for oracle driver for OLEDB connection
*Data Access mode - SQL Command
 
* SQL Command text - {call report.usp_get_unit_info}
 
If I click preview I get a window and see the top 200 rows.
But when I click Columns I cannot see the columns to map to an OLE DB Destination.
 
In PL/SQL I would run the following block.
begin
report.usp_get_unit_info(out_cursor => :out_cursor);
end;
 
I can write this in a script task but can't figure out why this won't work.
I could not find any information calling io cursor procs in oracle.
 
WT
Generalunable to castmembersuperman10013 Aug '08 - 14:12 
hong wei, i m facing an error, i dont know why when i m going to create a new job, after i done every of my selection, then i click "OK", program prompt up the following msg...
 

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)
 
i do need some help...thx!!
QuestionError code Error 15404memberMember 382627511 Aug '08 - 8:34 
Your article is so good. But I got an error when I am running the Job from SQL SERVER LOCAL. It gives me the following error.
 
“The job failed. Unable to determine if the owner (MEDICAHCP\ksenthil) of job FirstJob has server access (reason: Could not obtain information about Windows NT group/user 'DomainName\ksenthil'<c/> error code 0x5. [SQLSTATE 42000] (Error 15404))”
 
I am trying to fix this error more than 4 hours but I couldn’t do it. Please help me.

Thanks,
Kumar Senthil.
 
Note: I can run the package from VS with no errors. But not from the SQL SERVER AGENT.
AnswerRe: Error code Error 15404memberPedro B3 Jun '10 - 4:48 
**** THE ANSWER ****
 
SQL Server Error 15404, Could not obtain information about Windows NT group\user 'MyName\MyDomain',
error code 0x5 [SQLSTATE 42000]
---------------------------------
 
I have just had the same problem. I have read all over the internet about this but it took our IT
engineer who knows about SQL Server and AD to point out that I had set the SQL Agent to use a domain account but it was acutally the SQL Server service that brokers the requests to AD.
 
To resolve this problem, ensure that the SQL Server service account under "SQL Server Configuration Manager" is running under a domain user account.
 
Also, add this domain account to the Windows Group "SQLServerMSSQLUser$<your server name>$<instance name>" so it has the correct NTFS settings.
 
I believe you can leave the SQL Agent running under a restricted local server account. Similarly, add the local account to the Windows Group "SQLServerSQLAgentUser$<your server name>$<instance name>" so it has the correct NTFS settings.
 
This enables you to run jobs that are owned by a domain account and so they should be able to access network resources.
 
Regards,
 
Peter
 
Liverpool PCT, NHS, England
GeneralOMG Thank you so muchmemberanvie1 Aug '08 - 6:32 
I was wondering for HOURS why my Agent job doenst work until I read your article. Yhank you so much! Smile | :)
GeneralGreat working solution - I think there may be more thoughmemberJames Towell31 Jul '08 - 3:00 
Thanks Hongwei
It works really well.
I couldn't create a new login, so I used my own. Maybe that's what you intended.
So I have eunet\jtowell instead of devlogin
What that means is that the proxy has my account and password. And thus that when my password changes, as it is required to do every 30 days, I'll have to edit the proxy.
And, further, when my contract expires... well you can guess!
 
So, I need to search for a slightly more long lasting solution.
 
But the main thing is that it works for now and I can get on with the other parts of this solutions.
 
Cheers
GeneralDTS to SSIS conversionmemberSayCode24 Jul '08 - 4:50 
I used the coversion wizard to convert DTS to SSIS. The SSIS package is running great as myself, but when I schecule a job to run it (using SQL Service account) it fails at step trying to execute a SQL task, as opposed to data load tasks which are working fine in the same package. Any help would be appreciated.
GeneralRunning an SSIS packagememberStevie G22 May '08 - 1:02 
Excellent! If only Microsoft were as succinct.
GeneralGood Job Man!memberJonCR6 May '08 - 11:30 
It is a short and good explication. And the most important: it works!!
QuestionHow do I resolve error after following Step 1? [modified]memberPaul Cho7 Feb '08 - 10:16 
After following the step 1:
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
 
Then following error message box popped up:
Title of error message box is "Microsoft SQL Server Management Studio".
Content of error message box is
"Create failed for login 'devlogin'. (Microsoft.SqlServer.Smo)
Additional Information:
   An exception occurred while executing a Transact-SQL statement or batch.
   (Microsoft.SqlServer.ConnectionInfo)
         'devlogin' is not a valid Windows NT name. Give the complete name: <domain\username>.
         (Microsoft SQL Server, Error: 15407)".
 
Would you please respond me what should be done to do step 1 exactly as described in this article?
Thank you very much in advance.
 
Paul
 
<div class="ForumMod">modified on Thursday, February 14, 2008 9:44 AM</div>
AnswerRe: How do I resolve error after following Step 1?memberPaul Cho19 Feb '08 - 11:56 
I got it to working by using "Domain Name\Proxy Name" instead of just "Proxy Name" for Step 1.
Thank you.
 
Paul
GeneralGreatmemberCool_rajdevil12 Jul '07 - 3:40 
Great description.
It worked in a single shot!!!
GeneralI am not able to find the option: Package Source: File System.memberWadeDing29 May '07 - 7:23 
Hi Hongwei,
 
I followed you instruction, and I am not able to find the option: Package Source: File System.
I am using the SQL Server 2005 Developer Edition. Please let me if you know what I did wrong.
 
Thanks,
 
Wade
 
Moving forward every day, even just 0.00000000001 mms

GeneralRe: I am not able to find the option: Package Source: File System.memberhong_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.memberWadeDing30 May '07 - 2:29 
I guess I didn't deploy it as File System.
Thank you,
Wade
 
Moving forward every day, even just 0.00000000001 mms

GeneralRe: I am not able to find the option: Package Source: File System.memberWadeDing30 May '07 - 5:34 
found it. I am silly. Thank you for the post. Wade
 
Moving forward every day, even just 0.00000000001 mms

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 9 Jun 2006
Article Copyright 2006 by hong_wei_li@yahoo.com
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid