Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / SQL

Create New Jobs In SQL 2012

4.91/5 (7 votes)
14 Jul 2013CPOL1 min read 69.7K   1  
How to create new jobs in SQL 2012

Introduction

This post lists how to create new jobs in SQL 2012.

  1. Open ssms login in SQL Authentication:

    Image 1

  2. Start the SQL server agent if it is red color turn on like this:

    Image 2

  3. After starting the SQL Server agent double-click this agent, create a new job like this:

    Image 3

  4. Give name to this job I created name as sampledb_backup:

    Image 4

  5. Then, you can choose which logins you decided to authorize and category, also choose what we needed:

    Image 5

  6. Go to the second tab STEPS for what we performed in the database:

    Image 6

  7. Click new and give new name, then what type of language is to be selected. I am selecting T-SQL:

    Image 7

  8. After selecting this, you have to insert your queries like this or by using open button, you have to browse your queries:

    Image 8

  9. Then, pick the advanced button whether you have arranged one more step or finished my job you have used by this window:

    Image 9

  10. If job is a failure, what's next? You can run another job or quiet the job:

    Image 10

  11. Also, you can save that success or failure in a T-SQL format set path for output:

    Image 11

  12. After completing all these steps which login to perform this job, so you choose logins:

    Image 12

  13. Click ok, then click on the SCHEDULING tab:

    Image 13

  14. Give the name that you already created, time, occurs, time, date for user options:

    Image 14

  15. Other three tabs like alerts, notifications, targets is your choice of action can be performed like sending mail, etc. That’s all. If there are any modifications to be done after saving that job, go to SQL Server agent->jobs->sampledb_backup->double click, then modify it:

    Image 15

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)