• maybe you could try this. with a little bit more parameterisation, you could make a proc.

    Check if a backup operation is running for this particular DB then if it is not at that instant, then do a backup.

    Declare @dbname sysname = 'MyDB'

    declare @dbid int = (select max(database_id) from sys.databases where name = @dbname)

    if not exists( select null from sys.dm_exec_requests

    where command = 'BACKUP DATABASE'

    and database_id = @dbID)

    Begin

    BACKUP LOG @dbname TO DISK = N'I:\Backups\MyDB.trn' WITH NOFORMAT, NOINIT,

    NAME = N'MyDB-LOG Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

    END

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]