Wednesday, August 7, 2013

Making a New Job in MS SQL SERVER 2008 R2

  • Go to Object Explorer on the left tab of MS SQL Server Management Studio.
  • Right click on SQL Server Agent and Run it.
  • Maximize it and you will find the Job folder. Then Create a New Job on right clicking the Job folder.
  • A window will open with a General page. Fill the Name and Description of your Job. Remember the Enable is checked.
  • Go to Steps page and Create a New Job Step.
  • Fill the Step Name, Select Type, Select Database , Fill Command and Parse it. Go to Advanced Page if You want to set any action during Job Step success and failure. Press OK when command is successfully parsed. 
    • Example: 
      • Step Name :  InsertStep
      • Type : Transact-SQL script (T-SQL)
      • Database : testdb
      • Command: 
        • INSERT INTO [dbo].[UserTable] (UserName,Address) VALUES ('Earth','Milky Way Galaxy')
      • Parse the Command and Click OK
  • Go to Schedules page and Create a New Schedule or Pick one. 
    • Creating New Schedule
      • Fill the name.
      • Set Frequency, Daily Frequency and Duration.
      • Click OK.
  • Check if Job is executed successfully. (Checking [dbo].[UserTable] )

No comments:

Post a Comment