C# – How to schedule a job in Sql Agent (Sql Server 2005) via C# code

c++scheduled-taskssql-server-2005

Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code… i.e. when someone clicks a button on an asp.net web page.

How can I do this?

Thanks!

Best Solution

Have a look here: SMO Job Class

The SQL Server Management Objects (SMO) Class Library lets you do practically anything programmatically in SQL Server.