Skip to main content

Questions tagged [policy-based-management]

For questions about SQL Server Policy Based Management

Filter by
Sorted by
Tagged with
1 vote
1 answer

How to write (postgres) RLS-policies for related/nested tables?

I have a database structure with lots of tables related to eachother. For the sake of this question let's simplify it a bit to a project-management idea: Organizations have Departments, Departments ...
Rien Heuver's user avatar
0 votes
1 answer

Run Policy Based Management On Central Management Server with Code

I have a jump\terminal server to administer 100 SQL Servers and want to evaluate my locally created policies across all the servers by using the Central Management Server but WITHOUT: creating the ...
Stackoverflowuser's user avatar
0 votes
1 answer

Apply policy management column name in SQL Server

I want to apply a specific rule when somebody create new column in SQL Server 2016 Enterprise. For example: NR_NameColumn = int IS_Deleted = bit DT_update = Date ID_User = int and etc... How can I ...
LB_'s user avatar
  • 3
0 votes
1 answer

Using whole row in Row Level Security policy

I am using row level security with function, for example CREATE POLICY person_select_policy ON core.person FOR SELECT USING (core.person_policy_check(id, 'read') = TRUE); Is it possible to pass whole ...
YangombiUmpakati's user avatar
0 votes
1 answer

SQL Service Account group policy permissions

I'm trying to establish the best practice standards for configuring service account permissions in Group Policy. Based on Microsoft documentation, SQL Server setup requests permissions for the per-...
steve's user avatar
  • 47
3 votes
1 answer

postgresql - Policy to prevent a field from being updated

How can I create a policy to prevent a field from being updated? I am thinking something like this: CREATE POLICY "test" ON posts.created_at FOR UPDATE WITH CHECK (exists(created_at)); ...
Jonathan's user avatar
  • 153
1 vote
1 answer

Postgres/Postgis : setting up rls policies

So i'm trying to configure the different accesses for mutliple users to my postgres/postgis database. Basically I have 1 manager user and 4 weak users accessing the db. What I would like to do is to ...
tonyduky's user avatar
  • 111
1 vote
0 answers

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 ...
Leonardo Lacerda's user avatar
1 vote
1 answer

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 ...
db2's user avatar
  • 9,658
-1 votes
1 answer

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'...
DBALUKE HUANG's user avatar
2 votes
2 answers

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 ...
user3399498's user avatar
1 vote
1 answer

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 ...
igelr's user avatar
  • 2,132
2 votes
1 answer

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 ...
Ben's user avatar
  • 179
5 votes
1 answer

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 ...
Martin Guth's user avatar
1 vote
0 answers

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 ...
Craig Dawson's user avatar
11 votes
1 answer

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 @...
John's user avatar
  • 471