How to refactor a SQL Server database by splitting a table

Depending on your environment, splitting a SQL table may have a positive impact on the overall database performance. For instance, in scenarios where a table contains some large but rarely used columns, moving them to a separate table will increase performance as the frequently used data will be stored in a much smaller table, and the rarely used data will be only looked up when required. The impact on performance caused by the occasional joining will be compensated just by having SQL Server look up the data that’s used more often in a table which requires less disk space leading thus to decrease in I/O and potentially increase in page cache hits.

March 17, 2015

How to refactor a SQL Server database table to add a surrogate key

Choosing a primary key is one of the most important steps in a database design. There are two types of a primary key – a natural key and a surrogate key.

In this article we will describe how to apply database refactoring on a SQL Server database and replace a natural key with a surrogate key by using ApexSQL Refactor a free SQL Server Management Studio and a Visual Studio add-in that provides numerous features for refactoring of SQL code and uses one of fastest SQL formatters.

February 27, 2015

SQL database refactoring – Finding external references by analyzing object dependencies

SQL Database refactoring becomes more complicated according to the degree of coupling in the database architecture; the more coupled things are coupled the greater the potential impact of any change. The simplest way to describe the concept of coupling is that if changing one module in one module of code or a program requires changes in another part of the same or external application, then coupling exists

April 4, 2014

SQL database refactoring – Introduction

What is database refactoring?

Database refactoring is a change in a database schema with a goal to improve a database design and retain both informational and behavior semantics

March 14, 2014

SQL database refactoring techniques – Rename method

Why rename?

Rename Table, Rename Column, and Rename View are structural refactorings. The main purpose to apply Rename Column, Rename Table, and Rename View are increasing readability, adopting database naming conventions, or clarifying the meaning of an object. In the case of renaming objects you should consider a cost of refactoring both database and external applications that access the database vs. an impact of the achieved readability

February 18, 2014

SQL code refactoring – ways to improve database design

A “one-to-many” relationship is one of the most common relationship types as many real world scenarios can be represented using it. For instance, the same product can be sold by more than one supplier; a customer can have more than address, and so on.

May 21, 2013