In previous articles about DMO I’ve talked about using DMO for jobs. In this
article we’ll look at how to use DMO to run a job – which might even consist of
more DMO!
Why execute a job rather than just execute the task directly? The same reason
you should use stored procedures instead of code – it’s faster, and more
importantly, it gives you a layer of abstraction. By saving the job on the
server, the DBA can easily alter it without having to have an application
recompiled (or even a registry setting changed).
Here is some code that shows how to connect to the server and run a job:
|
|