564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Scheduling Data Imports in SQL Server
Part three of a three-part series of blogs
If you frequently import data into a SQL Server database from the same source you'll probably be sick of going through the import wizard again and again. So why not learn how to schedule an automatic import of your data using SSIS packages and the SQL Server Agent? This blog explains how to do exactly that!
The final stage of this blog series is to create a scheduled job to execute the SSIS package on a regular basis.
You can schedule jobs using the SQL Server Agent. You should find this at the bottom of the list of objects in any database server that you've connected to in SQL Server Management Studio:
The SQL Server Agent appears at the bottom of the list of objects in a database server.
To create a new job using SQL Server Agent:
Right-click the Jobs folder and choose New Job...
You can then use the dialog box to set up the job you want to create. The steps we need to follow in order to schedule our SSIS package execution are described below.
The first step is to give the new job a sensible name, as shown below:
In the General category, enter a descriptive name for the job.
Next, you can create the steps that will make up the job. Our job should have only one step and here's how to create it:
Build a list of steps for the job using this page of the dialog box.
Use this dialog box to specify the settings for this job step.
The job should now consist of a single step:
Our entire job consists of a single step, but we could always add more to this by clicking the New... button at the bottom of the dialog box.
To ensure that the job runs at a specific time you need to specify the schedule for the job. To do this:
Use this page to set up the job schedule.
The options in this page of the dialog box are self-explanatory. The options we have selected here ensures the job will be carried out each week at 9am on a Monday morning.
When you have finished applying all of the settings listed above, you can create the job by simply clicking OK on the New Job dialog box.
Your new job will appear in the Jobs folder within SQL Server Agent.
And that's it! As long as your database server is running and SQL Server Agent has been started your data import will occur on a scheduled basis from now on.
Like what you've read? There's tons more resources for learning SQL here.
|Parts of this blog|
25 Aytoun Street