Policy-based Management

  • I've set up a Policy with a Condition that checks for any user-created stored procedures that start with sp_

    When I evaluate the Policy I get some unexpected results - see attachment. (BTW, how do I post an image to the forum rather than having to use an attachment?)

    Because my condition specifies 'NOT LIKE sp_%' I would not expect stored procs with a name that did not start with sp_ to fail the evaluation. The only ones I would expect to fail are those that start with sp_ i.e. the target of my Policy.Perhaps I have misunderstood the logic...or is there a known issue with this aspect of Policy-based Management?

    Thanks.

  • i suspect this may be your like clause

    _ is a wildcard in "like"

    try NOT LIKE '%sp[_]%'

    MVDBA

  • _ (underscore) : def : Any single character.

    example:

    WHERE au_fname LIKE '_ean' finds all four-letter first names that end with ean (Dean, Sean, and so on).

    use

    Not like 'sp[_]%'

    Tanx 😀

  • Ahh!

    Yep, that's fixed it. Many thanks to both of you. 🙂

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

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