Create a Job
To add a job first we have to use a stored procedure named sp_add_job
USE msdb ;
GO
EXEC dbo.sp_add_job
@job_name = N'Weekly Job' ; -- the job name
Then we have to add a job step using a stored procedure named sp_add_jobStep
EXEC sp_add_jobstep
@job_name = N'W...