Managing Jobs Part 3

  • In the article you stated "you'll have to store your code in a file and execute it as an OS task using wscript.exe" but what you really want to use is cscript.exe. This way, all your WScript.Echo calls get sent to the standard output and if you're saving the job step output to a log file, this will get sent to your log file. Unfortunately, if you're using wscript.exe, the Echo tries to pop up a message box which everyone knows is a bad idea on a production system!

    Thanks for this series on jobs, it has given me a lot to think about as I have six servers to manage and each one has 30+ databases and lots of jobs to go with them!

    Bryant E. Byrd, MCDBA

    SQL Server DBA/Systems Engineer

    Intellithought, Inc.

    bbyrd@intellithought.com

    [font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
    Business Intelligence Administrator
    MSBI Administration Blog

  • Didnt know that, great tip! Typically I write my code in VB, then port to VBS, so I never have echoes anyway. Glad it's helped. I've got at least one more to go where I'll talk about using exe's to package jobs.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Thanks for the series Andy.  I do have two questions though.  We are dealing with getting our DTS jobs under control.  Two things have surfaced just recently.  The first one is scheduling.  We have a lot of requirements for jobs that must run on odd-ball times.  For example, the last working day of the month, sixth to the last working day of the month, first working day of the month, etc.  Up to this point, we have had to programmatically handle this with a VBScript task in our DTS package.  It looks to a table and sees if the current date is in this table.  If so, then continue with package, otherwise stop running.

    Management says this is good enough and is looking elsewhere for a scheduler like there is on the mainframe (yuck).  Do you have any suggestions?

    Second question, has to do with DTS packages in general.  We have noticed that some of our packages show as a failed job, however we know that the package ran successful based on the outcome.  I haven't had time to investigate this, but my guess is that there is a VBScript task that is returning a controlled failure and for whatever reason DTS/Scheduler is picking this up and reporting the whole package as failed.  Have you seen this before?  If this is the case, then it would seem to me that you should be able to change the packages execution status.

    Thanks and look forward to your upcoming topics.

  • Interesting article - as it confirms my thoughts on the use of SQLAgent! Looking forward to the next installment

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply