eriksv88
eriksv88

Reputation: 3528

Create a new job in SQL Server 2005 with the use of code

How can you create a new job in SQL Server 2005 with the use of code? And not in SQL Server Management Studio.

Upvotes: 1

Views: 367

Answers (2)

onupdatecascade
onupdatecascade

Reputation: 3366

To see how it's done by example, you can make a job in Management Studio, then right-click / script the job out to a query window.

Upvotes: 2

AdaTheDev
AdaTheDev

Reputation: 147264

There's a series of system stored procedures that you should use as detailed on MSDN:

sp_add_job
sp_add_jobstep

Plus a couple more for settings up schedules.

Upvotes: 4

Related Questions