We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [policy-based-management]

For questions about SQL Server Policy Based Management

Filter by
Sorted by
Tagged with
1
vote
0answers
36 views

Issue with table naming policy with PBM - can't create it passed in the condition or not

I used PBM to create a condition to blocking create tables if nomenclature no haven't the prefix tbl: EXEC msdb.dbo.sp_syspolicy_update_condition @condition_id=24, @description=N'Necessário ...
0
votes
0answers
13 views

How Can I Evaluate a SQL Server Policy using T-SQL?

I have created a policy in SQL Server 2008 R2 and need it to be evaluated on demand - whenever a new database is created. In order to achieve that, I created a DDL trigger at server level, which ...
0
votes
0answers
16 views

Using Policy-Based Management to check backup history for an Availability Group database

I like using Policy-Based Management to do some simple "everything's okay" sanity checks and email me if something goes out of spec. Typically, I validate the time since the last full backup, both to ...
-1
votes
1answer
42 views

Why SP_Naming policy still blocked my correct creating? [closed]

I used PBM to manage my policy against my user DBs. The Condition is: Declare @condition_id int EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention', @description=N'', @facet=N'...
1
vote
2answers
593 views

Is it best practice to revoke server permissions to the server “public” role on SQL Server instances?

We have evaluated the Microsoft "best practice" policies (located at C:\Program Files (x86)\Microsoft SQL Server\number\Tools\Policies\DatabaseEngine\1033) on each of our SQL Server instances (example ...
1
vote
1answer
46 views

How to select only one database in a policy in SQL Server?

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 ...
2
votes
1answer
29 views

Enforce conditions on queries

Currently I have a simple schema, a sites table and an items table. Sites own many items, items has a siteId column to store the reference of the site which owns it. I'd like to be able to enforce a ...
5
votes
1answer
107 views

Prevent users creating constraints or indexes with no name

I have done some searching but haven't found a solution to my problem. I started with some databases where users didn't care to name PK constraints, foreign keys or indexes, ending up with system ...
1
vote
0answers
27 views

User-defined Policy Evaluates to True when Evaluated but False when Invoked by Test-SqlAvailabilityReplica

I created a PBM condition and policy in SSMS. The policy runs a T-SQL script using the ExecuteSql function against the Server facet to determine whether all databases that are expected to be a member ...
10
votes
1answer
332 views

Issue with Table Naming Conventions and Policy Management in SQL Server 2016

In SQL Server 2012, I had a policy set to not allow spaces in a table name. However, when I use the same policy in SQL Server 2016, I get an error. Here is the code for the condition: DECLARE @...