1

I am creating a new policy which shows sproc creation dates. I am based on Stored Procedure facet and appropriate condition is created. Now I want this policy to include only one database in an instance

enter image description here

When I select new policy from the dropdown menu, which is next to every keyword, it shows this

enter image description here

But my point is not to create a new condition for all databases.

My question is, is it possible to to run a policy only for one database in an instance, and if yes, then how?

Thanks for your time!

1 Answer 1

1

Policies are server-wide. But you can have a condition to only bother about the policy based on, for instance, the database name. And that is exactly what that condition that you were about to create would do. So keep creating that for the database name that is relevant for you and you have achieved what you want to achieve.

enter image description here

4
  • Thanks for the answer. I want to know where to specify the database name using GUI. I chose facet - Database above. What to do next?
    – igelr
    Commented Sep 5, 2018 at 15:41
  • Five the condition a name, for the Field, I think that you can select Name (which then is the name of the database). I can't verify that since I'm not on a SQL Server machine now, but it should be something obvious. Then you select = for the Operator and then you type your database name for Value. Commented Sep 5, 2018 at 17:43
  • The thing is that in MS SQL it does not let us to choose only one db there. I think maybe it is not possible from GUI, probably it could be done using TSQL?
    – igelr
    Commented Sep 6, 2018 at 8:52
  • I don't know what you mean by "choose only one db there". Just type the database name. See my edited reply above, the picture. Commented Sep 6, 2018 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.