Categories
Azure

Retaining Job History in Managed Instances

In a Managed Instance, the SQL Agent job history is fixed at 1000 records or 100 records per job. This isn’t configurable like a regular SQL Server install. So how can we maintain a history of these if we want to retain those records? There are 3 approaches which could be worth considering. Two of […]

Categories
SQL Server

Modifying Data in Multi Table Views

Last time out we looked at modifying data in a view, but this only worked when we had a view referencing a single table. Here we’ll look at how we can achieve the same result for a view which references multiple tables. This one will require a little more work for us in the form of some extra […]

Categories
SQL Server

Auditing Schema Changes with DDL Triggers

A couple of weeks back we looked at how to implement DDL triggers in a database and briefly created a couple as examples. This time we’ll put that into use with a particular purpose: to audit modifications to our database schema. Storing the audit Before we get to the trigger we want to create a table to […]

Categories
SQL Server

Implementing DML Triggers

Last time out we looked at implementing DDL triggers in SQL Server and today we’re going to look at the other commonly used trigger – DML. What are DML triggers DML triggers are used to react to events caused by data manipulation language (DML) statements. These events are targeted to a specific table or view and so […]

Categories
SQL Server

Implementing DDL Triggers

In SQL Server we have the ability to create triggers to respond to events occurring within our databases or across the server. These typically come in two varieties – DDL and DML triggers. Here we’ll look at what DDL triggers are and how to implement them. What are DDL triggers A DDL trigger is a […]