SQL Server Expert Blogs

Why Put Your Database into Source Control?

Simple-Talk on SQL - Mon, 07/07/2014 - 17:00

Checking program code into source control is a daily ritual for most developers, but versioning database code is less well-understood. Grant Fritchey argues that getting your databases under source control is not only vital for the stability of development and deployment, but it will make your life easier when something does go wrong.

Avoiding Database Deployment Disasters – 7 Tips

Simple-Talk on SQL - Tue, 07/01/2014 - 17:00

Anyone who has to manage database changes would love to be living the “continuous delivery” dream, but the reality of releasing database changes for many teams is rather more akin to praying nothing goes disastrously wrong. Here are 7 practical tips for anyone forced into a direct production upgrade.

Developing a Custom SSIS Source Component

Simple-Talk on SQL - Sun, 06/29/2014 - 17:00

SSIS was designed to be extensible. Although you can create tasks that will take data from a wide variety of sources, transform the data is a number of ways and write the results a wide choice of destinations, using the components provided, there will always be occasions when you need to customise your own SSIS component. Yes, it is time to hone up your C# skills and cut some code, as Saurabh explains.

Rollback and Recovery Troubleshooting; Challenges and Strategies

Simple-Talk on SQL - Wed, 06/25/2014 - 17:00

What happens if your database deployment goes awry? Do you restore from a backup or snapshot and lose all the data changes that have happened since then? Do you prepare rollback scripts to revert the changes whilst preserving the data? Do you branch by abstraction and toggle off the changes? Have you a blue-green deployment that can be switched? Do you quickly roll forward?

The Mindset of the Enterprise DBA: Creating and Applying Standards to Our Work

Simple-Talk on SQL - Tue, 06/24/2014 - 17:00

Although many professions, such as pilots, surgeons and IT administrators, require judgement and skill, they also require the ability to do many repeated standard procedures in a consistent and methodical manner. These procedures leave little room for creativity since they must be done right, and in the right order. For DBAs, standardization involves providing and following checklists, notes and instructions so that the results are predictable, correct and easy to maintain

Database Branching and Merging Strategies

Simple-Talk on SQL - Tue, 06/17/2014 - 17:00

Source control will allow you to maintain branches in the development of your database, but the subsequent merge isn't pain-free. How, from the practical perspective, can the database developer support the rapid development and delivery of features in an application? Versioning, branching and merging is part of the solution, but what about the rest of the solution?

SQL Server Tables - 11 Questions You Were Too Shy to Ask

Simple-Talk on SQL - Tue, 06/17/2014 - 17:00

There are some aspects of tables in SQL Server that a lot of people get wrong, purely because they seem so obvious that one feels embarrassed about asking questions. Robert Sheldon reckons that no questions about SQL Tables are off-limits, and deserve frank answers.

Experiments with NEO4J: Using a graph database as a SQL Server metadata hub

Simple-Talk on SQL - Mon, 06/16/2014 - 17:00

NEO4J, the graph database, can be used to provide answers that are very tricky for relational databases, including providing diagrams to show how SQL tables relate to each other, and the shortest chain of relationships between two tables, as David Poole demonstrates

Using Migration Scripts in Database Deployments

Simple-Talk on SQL - Mon, 06/16/2014 - 17:00

A SQL migration script is similar to a SQL build script, except that it changes a database from one version to another, rather than builds it from scratch. Although they're simple in essence, it is worth knowing how to use them effectively for stress-free database updates and deployments. It takes care to get them right, but it is worth the trouble.

Row Versioning Concurrency in SQL Server

Simple-Talk on SQL - Wed, 06/04/2014 - 17:00

The optimistic concurrency model assumes that several concurrent transactions can usually complete without interfering with each other, and therefore do not require draconian locking on the resources they access. SQL Server 2005, and later, implements a form of this model called row versioning concurrency. It works by remembering the value of the data at the start of the transaction and checking that no other transaction has modified it before committing. If this optimism is justified for the pattern of activity within a database, it can improve performance by greatly reducing blocking. Kalen Delaney explains how it works in SQL Server.

The SQL of The Game of Life

Simple-Talk on SQL - Wed, 06/04/2014 - 17:00

Joe finds a reference to Conway's Game of Life whilst clearing out his desk, and is suddenly gripped with nostalgia. It wasn't just flares, mullets and disco, but simple computer games in interpreted basic. Somehow, Conway s Game of Life was too intriguing to be abandoned in the attic. Can it be implemented in SQL? Joe sets up a challenge.

On Comparing Tables in SQL Server

Simple-Talk on SQL - Wed, 05/28/2014 - 17:00

How do you compare two SQL tables? Every SQL Developer or DBA knows the answer, which is 'it depends'. It is not just the size of the table or the type of data in it but what you want to achieve. Phil sets about to cover the basics and point out some snags and advantages to the various techniques.

Setting Up Your SQL Server Agent Correctly

Simple-Talk on SQL - Tue, 05/27/2014 - 17:00

It is important to set up SQL Server Agent Security on the principles of 'executing with minimum privileges’, and ensure that errors are properly logged and alerts are set up for a comprehensive range of errors. SQL Server Agent allows fine-grained control of every job step that should allow tasks to be run entirely safely even if they occasionally need special privileges.

Updated sp_indexinfo

Tibor Karaszi - Thu, 05/22/2014 - 10:09
It was time to give sp_indexinfo some love. The procedure is meant to be the "ultimate" index information procedure, providing lots of information about all indexes in a database or all indexes for a certain table. Here is what I did in this update: Changed...(read more)

On Adopting the Mindset of an Enterprise DBA

Simple-Talk on SQL - Sun, 05/18/2014 - 17:00

Although many of the important tasks a DBA has to perform should be done 'by hand', keying in commands or using SSMS, the canny DBA with a heavy workload will always have an eye to automating routine tasks wherever possible, or using a tool. Although the likely candidates for automation are often obvious, it is not always so. Time can often be saved in surprising ways.

TSQL User-Defined Functions: Ten Questions You Were Too Shy To Ask

Simple-Talk on SQL - Sun, 05/18/2014 - 17:00

SQL Server User-Defined Functions are good to use in most circumstances, but there just a few questions that rarely get asked on the forums. It is a shame, because the answers to them tend to clear up some ingrained misconceptions about functions that can lead to problems, particularly with locking and performance

Optimizing Transaction Log Throughput

Simple-Talk on SQL - Wed, 05/07/2014 - 17:00

As a DBA, it is vital to manage transaction log growth explicitly, rather than let SQL Server auto-growth events "manage" it for you. If you undersize the log, and then let SQL Server auto-grow it in small increments, you'll end up with a very fragmented log. Examples in the article, extracted from SQL Server Transaction Log Management by Tony Davis and Gail Shaw, demonstrate how this can have a significant impact on the performance of any SQL Server operations that need to read the log.

Producing JSON Documents from SQL Server queries via TSQL

Simple-Talk on SQL - Mon, 05/05/2014 - 17:00

Although SQL Server supports XML well, XML's little cousin JSON gets no love. This is frustrating now that JSON is in so much demand. Maybe, Phil suggests, it is possible to leverage all that XML, and XPath, goodness in SQL Server to produce JSON in a versatile way from SQL Queries? Yes, it so happens that there are plenty of alternatives.

The Performance of Traversing a SQL Hierarchy

Simple-Talk on SQL - Sun, 04/27/2014 - 17:00

Dwain Camps show that, depending on the size and characteristics of some hierarchical data, six different methods of traversal can each be the fastest at some point. He illustrates convincingly that It is dangerous to generalize from just one set of test data, and it is foolish to assume that, just because SQL code looks neat, it will perform well.

SQL Server Reporting Services Basics: Building SSRS Reports

Simple-Talk on SQL - Thu, 04/24/2014 - 17:00

SQL Server Reporting Services is one of the most popular components of SQL Server, but it has always been surprisingly difficult to get from one place all the basic facts you need to get up and running from scratch, to the point of producing reports. Here Kathi Kellenberger quickly describes the basics of SSRS before showing how to build quick, simple reports.