Is there a way to disable/enable all SQL Agent jobs using a set based
operation as opposed to a cursory approach that i can think of right now
If so, can one provide the SQL for itI don't think so, because you should be calling a stored procedure for each
job. (As opposed to updating a table somewhere in MSDB, which you shouldn't
do without fully understanding what else the procedure does.)
What is wrong with a cursor approach for this type of one-off, admin task?
On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Is there a way to disable/enable all SQL Agent jobs using a set based
> operation as opposed to a cursory approach that i can think of right now
> If so, can one provide the SQL for it
>|||Nothing wrong, always heard dreaded things about cursors and was just trying
to see if one could do so in a set based approach ?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:BE4926C4.181D%ten.xoc@.dnartreb.noraa...
> I don't think so, because you should be calling a stored procedure for
each
> job. (As opposed to updating a table somewhere in MSDB, which you
shouldn't
> do without fully understanding what else the procedure does.)
> What is wrong with a cursor approach for this type of one-off, admin task?
>
>
> On 2/28/05 2:53 PM, in article eGUAu8cHFHA.904@.tk2msftngp13.phx.gbl,
> "Hassan" <fatima_ja@.hotmail.com> wrote:
>
>|||NO! Not when you have to call a stored procedure for each item in the set.
And like I said, for one-off admin tasks that you're not performing
regularly, I wouldn't spend too much time worrying about the performance of
your chosen approach. Just get the task done, and then work on doing
whatever you need to do to not require that task to be necessary in the
future.
On 2/28/05 11:43 PM, in article uDpX3khHFHA.2276@.TK2MSFTNGP15.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:
> Nothing wrong, always heard dreaded things about cursors and was just tryi
ng
> to see if one could do so in a set based approach ?
订阅:
博文评论 (Atom)
没有评论:
发表评论