Re: Shipping the most current scheduled job logs

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Uri Dimant (urid_at_iscar.co.il)
Date: 08/10/04


Date: Tue, 10 Aug 2004 10:43:42 +0200

Perhaps
DECLARE @filename VARCHAR (100)
DECLARE @dt CHAR(8)
SELECT @dt=CONVERT(CHAR(8),GETDATE(),112)
SET @filename='MyFie_200408100130'
IF PATINDEX('%'+@dt+'%',@filename)>0
PRINT 'Exists'
ELSE
PRINT 'Does not'

"bjgriswold" <grizgirrl@hotmail.com> wrote in message
news:f46e4f05.0408091639.1af71cfb@posting.google.com...
> Forgive the newbie programmer.
>
> I am assisting someone else with a project to automate their
> notifications (sans notification services, which seems like overkill).
> Specifically, the manager wants the day's logs (backup logs, etc., not
> tran logs) emailed to him on a nightly basis. Since SQL Mail doesn't
> really work well in a clustered environment, I have already
> implemented another SMTP solution which works great.
>
> All jobs were created using maintenance plans. The manager likes to
> keep 90 days of logs, so I must build some logic into the job,
> locating only the current day's logs.
>
> Of course the logs use ISO dates at the end (filename_200408040130).
> Seems like this should be relatively straightforward, using getdate()
> as a variable (perhaps comparing getdate against the ISO dates on the
> end of the filenames).
>
> Any ideas are greatly appreciated.
>
> TIA,
>
> Grizgirrl



Relevant Pages

  • Re: Please critique this short script that scans a log file
    ... > transaction logs, etc. ... Don't declare all your variables up-top, ... This has nothing to do with Perl. ... Instead put %s in the format string and put the data to be ...
    (comp.lang.perl.misc)
  • RE: Shipping the most current scheduled job logs
    ... It is not clear if you want to delete these files or just selectively mail ... > Specifically, the manager wants the day's logs (backup logs, etc., not ... > Of course the logs use ISO dates at the end. ... > as a variable (perhaps comparing getdate against the ISO dates on the ...
    (microsoft.public.sqlserver.programming)
  • Shipping the most current scheduled job logs
    ... notifications (sans notification services, which seems like overkill). ... Specifically, the manager wants the day's logs (backup logs, etc., not ... as a variable (perhaps comparing getdate against the ISO dates on the ...
    (microsoft.public.sqlserver.programming)