SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); ServerConnection svconn = new ServerConnection(con); svconn.Connect(); Server server = new Server(svconn); JobServer jobServer = server.JobServer; Job job = null; JobStep step = null; // Create Job job = new Job(jobServer, job_Name); job.Create(); job.ApplyToTargetServer("(local)"); // Create db step if (createDB_command != "") { step = new JobStep(job, "Creationdb_Step"); step.Command = createDB_command; step.SubSystem = AgentSubSystem.TransactSql; step.OnSuccessAction = StepCompletionAction.GoToNextStep; step.Create(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)