0 Replies Latest reply on Dec 4, 2017 8:13 AM by martinoosthuyzen

    Exception Report on SQL Backups and SQL Jobs

    martinoosthuyzen

      hi everyone

       

      I am trying to build an exception report for SQL Backups as well as SQL Jobs.

       

      The backup query looks like this,

       

      SELECT

      Node.Customer

      ,Node.Caption [ServerName]

      ,App.Name [Instance]

      ,db.Name

      ,[LastBackup]

      FROM [dbo].[APM_SqlBbCurrentDatabases] db

      INNER JOIN

      [dbo].[APM_Applications] App ON db.ApplicationID = app.ID

      INNER JOIN

      [dbo].[Nodes] node ON App.NodeID = node.NodeID

      WHERE

      db.Name <> 'tempdb'

      AND

      datediff(HH, [LastBackup] , getdate() ) > 24

      AND

      db.Status = 1

      AND

      Node.Customer = ${Customer}

       

      This obviously doesn't work ;-)

       

      Is it possible in anyway that I can pass the ${Customer} parameter to the query via a session variable or something else?

       

      Thanks
      Martin