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
10 September 2010
10 September 2010

Showplan Operator of the Week – Stream Aggregate

Fabiano continues his mission to explain the Query Optimiser in practical terms, describing, one week at a time, all the major Showplan Operators used by SQL Server's Query Optimiser to build the Query Plan. He discusses the Stream Aggregate function and shows how easy it is to get performance gains in GROUP BY clauses by choosing the right index.… Read more
02 September 2010
02 September 2010

SQL Source Control: The Development Story, Part II

0
18
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

0
17
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

0
14
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
22 July 2010
22 July 2010

VALUES() and Long Parameter Lists

To make progress as a relational Database programmer, you have to think in terms of sets, rather than lists, arrays or sequential data. Until that point, you'll feel the need to pass lists, arrays and the like to functions and procedures. Joe suggests some unusual ways around the difficulty and broods on the power of the VALUES constructor.… Read more
20 July 2010
20 July 2010

Automate and Improve Your Database Maintenance Using Ola Hallengren’s Free Script

If you ever feel uneasy when you set about handcrafting database maintenance jobs for SQL Server, it may be the voice of your conscience saying 'Ola, Ola!'. Follow your conscience. Ola Hallengren has already crafted a superb set of routines to do this for you. Why reinvent something that does it all, safely and well. Brad McGehee explains....… Read more