Fatal action guard: guarding against inadvertent execution of code that may damage or destroy data in SQL Server

There are many opportunities, before, during and even after to guard against potentially fatal actions that may damage or destroy data, like executing an Update or Delete statement without a Where clause. Such a fatal action guard can be implemented in different ways and at different times, relative to the incident, for example, before it to prevent it from happening in the first place, or after, to reverse an action that has already been executed.

October 24, 2017

How to make SQL database version control safer with branches

The goal of this article is to explain how to use branches in order to diverge from the main development line aka master branch and leave it unaffected by all the committed changesets that are not yet tested and confirmed as good ones. As long as a separate branch is used to commit changes, a master branch can be used to deploy a working copy of a database from source control for any purposes.

October 23, 2017

How to set different connection colors in SSMS

Microsoft introduced a neat feature in SQL Server Management Studio (SSMS) in SQL Server 2008 that helps users quickly determine which connection a tab is currently using by setting custom connection colors in SSMS for different SQL Server nodes.

For database administrators who work on a multiple SQL Servers simultaneously, this feature is a time-saver that allows us to quickly determine which SQL Server we are currently using by looking at a color defined for the associated server.

October 18, 2017

General Data Protection Regulation (GDPR) compliance for SQL Server

On April 27, 2016, the European Parliament and the council of the European Union adopted a new standard, the General Data Protection Regulation on the protection of natural persons with regard to the processing of personal data and on the free movement of such data. The GDPR takes effect on May 25, 2018 and introduces numerous security and compliance regulations and obligations to all organizations worldwide, that handle, process, collect or store personal information of EU citizens. This means that organizations, both the data processors and data controllers, will have to elevate security measures and auditing mechanisms when handling personal identifiable information (PII) of EU citizens and be able to demonstrate compliance with GDPR standard at all time, not only on regular basis (monthly, yearly), but also on demand.

October 13, 2017

SQL Server performance monitoring – identifying problems using wait statistics and query wait analysis

In aggregate, SQL Server Wait statistics are complex, comprising hundreds of wait types registered with every execution of the query. So, to better understand how and why the wait statistic, in general, is the most important for detecting and troubleshooting SQL Server performance issues, it is important to understand the mechanism of how a query executes on SQL Server, since SQL Server performance problems are the ones that most often affect end users.

October 6, 2017

How to export SQL Server data to a CSV file

This article will explain different ways of exporting data from SQL Server to the CSV file. This article will cover the following methods:

  1. Export SQL Server data to CSV by using the SQL Server export wizard
  2. Export SQL Server data to CSV by using the bcp Utility
  3. Export SQL Server data to CSV by using SQL Server Reporting Services (SSRS) in SQL Server Data Tools (SSDT) within Visual Studio
  4. Export SQL Server data to CSV by using the ApexSQL Complete Copy results as CSV option
October 4, 2017

Multi server PowerShell script to backup SQL Server databases automatically

Eighty-two percent of the enterprises expect the number of databases to increase over the next twelve months. An increase in data volumes can have negative effects on the performance of databases. Think about the storage requirement and backup strategy to meet the Recovery Time Objective and the Recovery Point Objective. RPO and RTO are two of the most important parameters of a disaster recovery or data protection plan.

September 27, 2017

How to use source control with SQL Server Management Studio (SSMS)

Introduction

The growing adoption of Continuous Integration development practice implies that developers have to work in a collaborative manner by storing and sharing their source code into a central repository. For SQL Server Business Intelligence (SQL Server BI) developers, the collaboration is usually made possible by the Team Explorer plug-in for Visual Studio which provides an interface for integrating SSRS, SSIS and SSAS solutions into source control environments such as Team Foundation Version Control (TFVC) or Git. However, several aspects of SQL Server BI solutions involve T-SQL development (i.e. defining of SSRS datasets, SSAS data source views, as well as SSIS source data flow tasks).

September 25, 2017

Creating and automating Tableau Site documentation

One of many Tableau administrator responsibilities is to be familiar with the server configuration, managing users, automated server job process management, knowing Tableau metadata and being familiar with migration and scheduling. To stay updated and keep everything under control, good Tableau documentation can come in handy. Such documentation can be created using ApexSQL Doc, a tool for creating SQL Server, BI, SharePoint as well as Tableau site documentation, which will be covered in this article.

September 22, 2017

How to create and use DML triggers to audit data changes

A DML trigger is a special kind of procedural code programmed to fire when a data manipulation language (DML) event occurs in the database server. DML events include UPDATE, INSERT, or DELETE statements issued against a table or view. SQL Server has three types of triggers: DML triggers, DDL triggers, and logon triggers. For the purpose of this article, only DML triggers will be used to demonstrate and achieve a specific goal.

September 21, 2017