Policies - T-SQL

  • Hi,

    I am trying to use policies to ensure that all of my production databases have had a successful dbcc checkdb run against them every 24 hours.

    I found some T-SQL on here that will check for the date of the last checkdb occurrence, but I can't find anyway of using T-SQL in policies.

    Can anyone suggest how I would go about doing this, or if there is a better way of achieving the same result?

    Thanks,

    Bodsda

  • The best way to do this is to have a scheduled job that runs your dbcc command. It should include success testing and write the results to a logging table.

    This is the only way I can think of off the top of my head right now.

  • Hmm, yeah that's what I'm currently doing. Would have been nice to use policies though.

    I get the feeling that the policies are some bodge add-on that got hacked into the final release at very short notice. It feels very out of place and is poorly designed. Hopefully it has been reworked in Denali.

    Bodsda

Viewing 3 posts - 1 through 3 (of 3 total)

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