08 October 2010
08 October 2010

State Transition Constraints

Data Validation in a database is a lot more complex than seeing if a string parameter really is an integer. A commercial world is full of complex rules for sequences of procedures, of fixed or variable lifespans, Warranties, commercial offers and bids. All this requires considerable subtlety to prevent bad data getting in, and if it does, locating and fixing the problem. Joe Celko shows how useful a State transition graph can be, and how essential it can become with the time aspect added.… Read more
27 September 2010
27 September 2010

Working with the INSERT statement in SQL Server

The INSERT statement in SQL Server is versatile. It now allows the insertion of multiple rows of literal values. It also provides the output clause that solves a number of common problems such as ascertaining the value of identity fields, and other calculated fields in tables, or for auditing the rows that are added to tables. Robert, once again, gives a clear introduction. … Read more
20 September 2010
20 September 2010

Parameter Sniffing

If a SQL query has parameters, SQL Server creates an execution plan tailored to them to improve performance, via a process called 'parameter sniffing'. This plan is stored and reused since it is usually the best execution plan. Just occasionally, it isn't, and you can then hit performance problems, as Greg Larsen explains.… Read more
02 September 2010
02 September 2010

SQL Source Control: The Development Story, Part II

When creating SQL Source Control, the team had to make decisions as to which source control systems the tool would support, and needed to accomodate a range of different development practices. It also had to avoid the potential problems from the fundemental differences between database builds and application builds, David and Stephanie, from the team that wrote the tool, explain what they did, and why.… Read more
18 August 2010
18 August 2010

Rebuilding Indexes using the SSMS Database Maintenance Wizard

Index fragmentation can cause problems with query performance. Indexes therefore need to be occasionally rebuilt. the Rebuild Index task of the SSMS Database Maintenance Wizard drops and rebuilds every index in a database. It is effective but an off-line activity that is resource-intensive, so it not always the best way of avoiding index fragmentation in a production database. Brad explains...… Read more
17 August 2010
17 August 2010

The DIS-Information Principle: A Splitting Headache

You can easily re-factor bad DML code, but if a database design is wrong, you can do little to rescue the problem, even with expert queries. So what constitutes 'wrong RDBMS design? What are these errors that continually crop up? How can you recognise them and fix them? Joe embarks on a new series of articles by identifying a series of bad practices based on the habit of 'splitting' that which shouldn't be split.… Read more
and 17 August 2010
and 17 August 2010

DMVs for Query Plan Metadata

Before you can tackle any performance issues with a working database, you need to know which queries to work on first: The ones that are taking the most time in total, and which are the most expensive in terms of cache, CPU and disk. Although SQL Server Management Studio can help, it isn't long before you need an armoury of DMVs to provide you the statistics to find the culprits. … Read more
05 August 2010
05 August 2010

SSN Matching Speed Phreakery

On Ask.SQLServerCentral.com, a group of people interested in experimenting with heavily optimised SQL techniques try them out on a problem, using reasonbly large amounts of data. They aren't so interested in explaining the techniques, so Kathi continues on her mission to explain the lessons learned and the tips that can be derived.… Read more
05 August 2010
05 August 2010

When Database Source Control Goes Bad

It is a question every development manager dreads; "So how does your company handle database changes?". The reply usually masks a multitude of sins against all the canons of version control. Mike has seen most of these sins and, like the ancient mariner, is keen to give you the awful warning, 'Neglect database source control at your peril'.… Read more
23 July 2010
23 July 2010

Product Review: Schema Compare for Oracle

One of the more important tasks in the process of rolling out incremental developments to a multi-server production system is to double-check that all of the planned modifications, and nothing else, have been deployed. An Oracle expert, Bruce Armstrong, comes across SQL Compare for Oracle, and sees if it helps with this time-consuming task.… Read more
22 July 2010
22 July 2010

SQL Source Control: The Development Story

Often, there is a huge difference between software being easy to use, and easy to develop. When your pilot users tell you "by week three of any development project you've thrown out anything that takes time or just gets in your way", then it is time to be serious about usability, as well as quality. We decided to find out from some of those at the sharp end of the development of Red Gate's SQL Source Control.… Read more