Friday, February 24, 2012

Handling Error Messages

I am trying to run a command, say "logman start perfcollection" and the
error i receive is that the "Collection is already running"
I am running it as a SQL agent job and because the command is already
running, it fails with the error.
How can I check for that message and if its that message, than I want to
pass it as success condition.
ThanksHi Hassan
Try running the command through xp_cmdshell the return value should be
-1073738775 when the log is already running, alternatively you could always
stop it first before starting it as this will not cause an error.
John
"Hassan" wrote:

>
> I am trying to run a command, say "logman start perfcollection" and the
> error i receive is that the "Collection is already running"
> I am running it as a SQL agent job and because the command is already
> running, it fails with the error.
> How can I check for that message and if its that message, than I want to
> pass it as success condition.
> Thanks
>
>
>

No comments:

Post a Comment