Categories
SQL

Dealing with Duplicate Data

Data quality and consistency is key to the services we support and solutions we deliver. A gremlin which can undermine that is duplicate data. Let’s start the new year dealing with duplicate data and having a good clear-out. For our example we’ll consider an Order Product table which contains an OrderID and ProductID, and the combination of these should […]

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 […]

Categories
SQL

Benefits of Vertical Partitioning

We recently looked at implementing vertical partitioning on a set of data. In an earlier introduction post we also mentioned the benefits which can be seen as a result of the partitioning in both our maintenance and querying of the data. Here we’ll take a look at those benefits with a little more evidence. We’ll be using the data […]

Categories
SQL

Changing Identity from INT to BIGINT

When creating tables we may choose to use an INT column with an IDENTITY set as a unique clustering value. On occasions we find out that being able to store 2,147,483,647 records just isn’t enough and we need to change this field to be a BIGINT to let us store… well, a lot more. Here I’ll outline one approach which could […]

Categories
SQL Server

Partition Switching in SQL Server

Continuing with our recent theme of partitioning I wanted to make sure that we looked at one of my personal favourite features – Partition Switching. Partition Switching is the ability to switch an entire partition of data from one table to another almost instantly. Where it gets interesting is that this is the same operation […]

Categories
SQL Server

Managing Table Partitions (Part 2)

Last time out, following up to our posts looking at an introduction to partitioning and how to implement it we started to look at how to manage partitions. In this post we’ll continue that theme by looking at how we’d go about removing (or merging) partitions as well as covering some general considerations when we’re performing operations on partitions and […]

Categories
SQL Server

Managing Table Partitions (Part 1)

Last time out we tried our hand at implementing partitioning on a table with some data inside it. We looked at creating the partition function, followed by the partition scheme, and then applied that to our table and looked at the results. Following up on that I now wanted to look at how we can manage […]

Categories
SQL Server

Implementing Table Partitioning

A little while back we looked at an introduction to table partitioning where we covered the concepts involved in the partitioning. This time out we’ll look at how to implement those concepts to create a partitioned table. As we’re going through the motions for this let’s start off by creating a table and fill it with some […]

Categories
SQL Server

Introduction to Partitioning

In SQL Server you can use partitioning to split a table into multiple segments based on the data contained within it. This feature can be used to bring improvements to performance and provide more flexibility with maintenance for those tables which are partitioned. The impact of these will be key for large data sets where […]