04 July 2008
04 July 2008

DML Trigger Status Alerts

When databases suddenly stop working, it can be for a number of different reasons. Human error plays a large part, of course, and the DBA needs to know what these various humans are up to. DDL triggers can help alert the DBA to unauthorized tampering with a production system, of course, but DDL triggers can't tell you everything. At some point, you will need to implement your own checks.… Read more
23 May 2008
23 May 2008

Close these Loopholes – Reproduce Database Errors

This is the final part of Alex's ground-breaking series on unit-testing Transact-SQL code. Here, he shows how you can test the way that your application handles database-related errors such as constraint-violations or deadlocks. With a properly-constructed test-harness you can ensure that the end-user need never sees the apparent gobbledegook of database system error messages, and that they are properly and robustly handled by the application.… Read more
11 May 2008
11 May 2008

Execution Plan Basics

Every day, out in the various discussion boards devoted to Microsoft SQL Server, the same types of questions come up again and again: Why is this query running slow? Is my index getting used? Why isn't my index getting used? Why does this query run faster than this query?. The correct response is probably different in each case, but in order to arrive at the answer you have to ask the same return question in each case: have you looked at the execution plan? … Read more
15 April 2008
15 April 2008

The Case of the Skewed Totals

Even when your code tests out perfectly in the standard test cell, you can experience errors in the real production setting where several processes are hitting the database at once, in unpredictable ways. You shouldn't, of course, let it get that far, because there are now ways of simulating concurrency during the test process.… Read more
01 April 2008
01 April 2008

The Concept of Cardinal Reciprocity- A Primer

Too many authors in the field of relational theory have neglected the concept of Cardinal Reciprocity. This can cause a number of subtle problems with database design in terms of its derivability, redundancy, and consistency. . Increasingly, this little-understood aspect of relational theory, that emphasises the cardinality of the attributes of tuples in a relation and the reciprocity with isomorphic foreign key restraints, is becoming a hot forum topic.… Read more
31 March 2008
31 March 2008

Towards a Better Beta

David Connell describes how the team that developed Red-Gate's SQL Data Generator tool came to realise that database developers and DBAs already knew what they wanted for their test data. The team wanted to use the Beta version of the program to get a clear message from them. . And then came the daunting task of working out the best way of incorporating all this wisdom into the final product.… Read more
14 March 2008
14 March 2008

SQL Server Tracing: An Automated and Centralized Solution

When you are trying to pin down the cause of a problem with a SQL Server, there is probably going to come a time when you need to get 'trace' information. If you've ever done that, you'll know how easy it is to get overwhelmed by the detail. Here, Shawn McGehee shows how to get round the problem by capturing trace information on a schedule, filtering the captured information, and monitoring it from a central location. … Read more
19 February 2008
19 February 2008

The Database From Hell

In which Arthur Fuller comes to the aid of a friend who is doing his best to administer The Database From Hell, and manages to set up a reasonable test database with which to solve some of the headaches that only a 65 million row, 600 column, table can cause.… Read more