In This Article i am going to describes how to create a SQL Server Agent job step that executes SQL scripts in SQL Server 2012 by using SQL Server Management Studio,I am giving you a example to take backup (.BAK) file of sql server database on daily basis at some specific time which is given in job scheduler.
SQL Server Management Studio can be used to create a database backup job to take backup of an user database. Just following some steps and UI work process to create a simple backup job, run the job and you can see the results on screen.
Step 1:- SQL Server Management Studio and login with your credential.
Step 2:- After connect to sql server,Expand object explorer=>sql server agent=>Exapnd Job=>Right click=>select in menu "New job".see image..
Step 3:- Select General=>type name of sql agent job,you can write description also. see image....
Step 4:- Select Steps=>Click "New"=>"OK" on bottom of screen.see image....
After click on new open new tab see in next screen.
Step 5:- Select General=>type Step name=>Command ,In command panel you can use sql query.see image...
Here my query is use to take backup of sql database.I have created a cursor to take backup file of database.
Step 8:- After click on "Start job at step" your job is running and performing according your query.see image....
Also you can check status of job in this panel.
Step 9:- After job completion you can see the "success" status for this job,see image....
After that you can check your back file (.BAK) file has been created on specified path.
Step 10:- After job completion you can see the history of job.see image..
After that you can see whole information and history of your job.see image..
You have just read an article that categorized by title SQL by title Part 33::Create sql server database backup(.BAK) file using sql server job agent.. You can bookmark this page with a URL https://bikeshsrivastava.blogspot.com/2016/09/part-33create-sql-server-database.html. Thank You!
Author: Bikesh Srivastava - Friday, 2 September 2016