Introduction
In this article, you will learn how to create a new job and schedule that job for execution in SQL Server.
Describe a SQL job. A job is a predetermined set of tasks that a SQL Server Agent completes. To define an administrative task that can be executed once or more times and its success or failure tracked, use jobs. A job may execute on a single local server or a number of distant servers. Automatic weekly backups, automatic email sending, newsletters, writing log files, and audit log writing are a few instances of SQL Jobs.
Getting Started
Start SQL Server 2008 Management Studio first. You can choose a database to build and schedule a job from by expanding the Databases node.
Create a Job in SQL
I’m going to create and schedule a job for this database.
Now click on SQL Server Agent, choose “Jobs,” and then use your right mouse button to pick “New Job.”
There are numerous steps, as you can see, so let’s take them one at a time. Give the position’s name and description first, then click “OK.”
General Tab
Click “Next” now. Steps is the name of the step, which asks for a name, a type, a database selection, and a command to store somewhere before asking the user to click “OK”.
Steps Tab
Once you have entered the name, type, and frequency, click “OK” on the “Schedules” page.
Schedules Tab
Then select the Alerts tab, click the “Add” button, enter the alert name, type, and database name, and then select “Ok.”
Alerts Tab
Select how you want notifications by clicking the notifications tab now.
Notifications Tab
The “Targets” tab, which is the last tab, displays the choices for the target server and allows you to choose numerous target servers.
Targets Tab
Summary
We learned how to set up and schedule a job in SQL Server in this post.