Creating A SQL Server Agent Job To Call A Deployed SSIS Package
Creating A SQL Server Agent Job To Call A Deployed SSIS Package
Though you may already be familiar with creating an automated SQL Server Agent Job utilizing a stored procedure, configuring it to work with a deployed SQL Server Integration Services (SSIS) requires a slightly different approach. The steps outlined in this article assume you have already deployed your integration services package onto the server. If this is not the case and you would like to learn more about how to do this, I have an excellent post that should get you started, A Guide To Creating A SQL Server Integration Services Catalog and Deploying An SSIS Package .
So let’s assume you have an SSIS package that has been deployed and you have created an SSIS catalog within SQL Server. Now you would like to schedule the package to run through a SQL Agent Job. The steps outlined below will walk you through the process of getting it configured and running on a schedule of your choice.
Before you can create a SQL Server Agent Job you need to make sure the SQL Server Agent service is installed and running on the server. You can verify that the service is installed and running by connecting to the server and looking at the SQL Server Agent drop-down at the bottom of the server list. If the icon shows a green arrow then you’re all set.
In most cases it should already be running. However, if it is not, you will need to open SQL Server Configuration Manager and locate the SQL Server Agent service on the SQL Server Services pane as shown below.
If the State of the service does not show Running then simply right-click the service and select Start .
If for some reason the service is not listed, then it was not selected when SQL Server was installed. You will need to launch the installation package again and choose to install the service.
Now that you have confirmed that the SQL Server Agent service is running it is time to create the agent job.
The first step is to locate the SQL Server Agent drop-down after connecting to the server through SQL Management Studio. Expand the drop-down and right-click Jobs . Select New Job… from the list.
The New Job window will be displayed. This window contains multiple pages which allow you to configure all aspects of the job. The initial page that will be displayed is the General page, shown below. Here is where you will name the job and set ownership.
Enter a name for the job. In this case I am creating a job to execute an SSIS package that loads data into a BI360 data warehouse. By default the owner will be set to the domain account that is creating the job. It is generally good practice to have a service account or commonly used account to own all jobs. In this case I will simply leave my account as the owner.
It is never a good idea to have the systems administrator (‘sa’) account as the owner.The Category option is less important here. By default it may be set to [DB Maintenance]. You can leave it as that or change it to something more relevant if applicable. In the example above I have set it to [Uncategorized(Local)].
Once the steps above have been completed it is time to configure the actual steps that the job will perform. To do this, select the Steps page on the left hand side of the window.
To begin configuring each step of the job click the New… button.
An individual step will need to be created for each SSIS package within a project that you wish to call. If you have 5 SSIS packages that need to be called within the job, you will need 5 steps. Each step will, by default, be called in the order in which they are listed on the Steps page. You can change the order of the steps once they have been created using the up and down arrows above the New… button.
After clicking New… the New Job Step window will be displayed. Here you will name the step and configure the individual SSIS package that will be called.
I have found that a good practice, especially when dealing with an agent job that will call multiple packages, is to name the step based on the package that is being called.
In the example above I will beconfiguring the step to run the Dimension_Load.dtsx package so I have named the step Dimension Load .
By default the Type will show Transact-SQL script (T-SQL) . Since we are going to utilize an SSIS package this needs to be changed to SQL Server Integration Services Package . Once the type has been changed the window will update to reflect the new options that are available based on this type.
From here I will be working under the assumption that the SSIS packages are contained within an SSIS Catalog on the server. If you do not already have an SSIS Catalog created, refer to the link at the top of the article related to creating an SSIS Catalog.
On the Package tab next to Package source , select SSIS Catalog and enter the server name next to Server . In the example above I am specifying theLAB-SQL2012 server..
The next step is where you will select the actualSSIS package to be used within the Job step. Click the ellipses at the bottom of the New Job Step window under Packages.
A new window will appear where you can select the SSIS package. Navigate down through the Integration Services Catalogs drop-down until you locate the applicable catalog. In the example above I am selecting the Dimension_Load.dtsx package in the BI360DW catalog.
Click OK once you have selected the package.
The Packages text box will now display the path to the SSIS package as shown below.
Before clicking OK to save the job step select Advanced from the page list on the left hand side of the window.
Depending on the number of job steps you will be creating within the SQL Agent Job the settings here may require modification. In this example I am only creating a single step to call a single SSIS package. If you are calling multiple SSIS packages within the job you would simply repeat the above steps for each SSIS package. Each step would have its own options here.
By default the On Success action: drop-down will display Go to the next step. If you are planning on having multiple steps within the job then this is the correct setting to have so that the job will immediately call the next step. However, in this example I am only creating a single step within the job. Since this is the case, I have changed this to Quit the job reporting success .
Once all applicable modifications have been made, click OK .You should now see the newly created Step on the Steps page of the New J
本文数据库（mssql）相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库
本文标题：Creating A SQL Server Agent Job To Call A Deployed SSIS Package