SQL Server- Use Database Snapshots for Code Deploys to Recover a Single Table or Entire Database

I have found that database snapshots are under-utilized and wanted to show an example of how efficient it is to use them prior to a code deploy for the purpose of recovering a single table or reverting an entire database from a snapshot in the event of unexpected functionality within an application.

Continue reading SQL Server- Use Database Snapshots for Code Deploys to Recover a Single Table or Entire Database

SQL Server- Move a Clustered Primary Key Index to a New Filegroup

In effort to clean up database environments, we as DBAs are often asked to either move tables to a different file group or to consolidate multiple filegroups and the number of database files into one. The recommended way of accomplishing this task is to drop and create a clustered index on the new filegroup; however, whenever the clustered index is also a primary key, this process becomes very inefficient and resource-intensive since we have to drop all of the foreign keys, the clustered primary key, and then recreate the clustered primary key and all of its dependencies.

Continue reading SQL Server- Move a Clustered Primary Key Index to a New Filegroup