SQL Solution center round-up – February 28th, 2014 – SQL refactoring techniques and SQL Server auditing

In the last two weeks, we focused on SQL database and code refactoring techniques and tracking SQL Server objects used

In the first article of the SQL database refactoring techniques series, we explained what SQL database refactoring is, presented six categories of database refactors, and described the process of database refactoring

After presenting the refactoring basics, in SQL database refactoring techniques – Rename method we focused on table, column, and view renaming. We gave examples for renaming SQL Server columns and tables using the built-in sp_rename procedure, and for dropping and recreating views using CREATE VIEW and DROP VIEW. As these methods don’t automatically find dependencies and rename references to the renamed objects, we showed how to use ApexSQL Refactor and update all object references automatically

Replacing a natural key with a surrogate key is the next article in the SQL database refactoring techniques series. It explains what natural and surrogate keys are, why to replace a natural with surrogate key, and how. The solutions given are via T-SQL code and using ApexSQL Refactor

Tracking SQL Server object usage lists the most common scenarios when tracking SQL Server object usage is required. The article shows how to achieve that using the SQL Server Audit feature introduced in SQL Server 2008 and developed on top of Extended, and ApexSQL Audit built on top of SQL Server traces

February 28, 2014