Dwain Camps The Performance of the T-SQL Window Functions Window Functions in SQL greatly simplify a whole range of financial and statistical aggregations on sets of data. Because there... 17 January 2014 16 min read
Hugo Kornelis Generating Test Data in TSQL To test SQL, you need test data. There are usually many reasons why you can't use production data. Although it... 14 January 2014 30 min read
Dev Nambi Agile Database Development Agile methodologies work well with database developments only if great care is taken to do things right. It requires good... 03 January 2014 28 min read
Dwain Camps Calculating the Median Value within a Partitioned Set Using T-SQL It is ironic that one of the most essential of statistical aggregations, the median, has been so difficult in the... 17 December 2013 12 min read
Joe Celko Window Functions in SQL SQL's windowing functions are surprisingly versatile, and allow us to cut out all those self-joins and explicit cursors. Joe Celko... 31 October 2013 16 min read
Dwain Camps Calculating Values within a Rolling Window in Transact SQL Before the SQL Window functions were implemented, it was tricky to calculate rolling totals or moving averages efficiently in SQL... 17 October 2013 19 min read
Joe Celko Databases and Dominoes A Dominoes game of Texas 42 inspires Joe to explore unusual uses for check constraints and views. Sometimes, the best... 09 September 2013 14 min read
Dwain Camps Gaps and Islands in SQL Server: Fast Set-Based Solutions Compared Efficient SQL Server solutions to the gaps and islands problem - detecting unbroken sequences and the gaps between them. Covers... 25 July 2013 16 min read
Phil Factor SQL Server ALTER TABLE syntax diagrams The words in the documentation for the ALTER TABLE syntax on MSDN are accurate with forensic precision, but the potentially-useful... 09 July 2013 8 min read
Hugo Kornelis Painless management of a logging table in SQL Server Tables that log a record of what happens in an application can get very large, easpecially if they're growing by... 11 June 2013 26 min read
Phil Factor SQL Server CREATE TABLE syntax diagrams Many of us have seen, on MSDN, the heading 'Syntax', followed by a rash of nested brackets and keywords, enough... 06 June 2013 8 min read
Joe Celko The SQL of Parts Explosions Parts explosions present a classic IT problem. How can one calculate such things as weight or cost of assemblies in... 30 May 2013 11 min read
Robert Sheldon tSQLt Tutorial: Unit Testing SQL Server Databases with Test Cases and Fakes A complete tSQLt tutorial for SQL Server unit testing: setting up the tSQLt framework, creating test classes and test cases,... 08 April 2013 23 min read
Hugh Bin-Haad TSQL Pivot Rotations using only REPLACE Pivoting SQL Server tables is always awkward, even with the PIVOT and UNPIVOT operators. If you want to get the... 01 April 2013 8 min read
Kathi Kellenberger Solving Complex T-SQL Problems, Step-By-Step What should you do if your first, most intuitive solution to a problem ends up scanning the data more than... 18 March 2013 19 min read
Robert Sheldon SQL Server 2012 Window Function Basics For some time, Microsoft had a few window functions, but not the full set specified in the SQL 2003 standard.... 05 March 2013 21 min read
Joe Celko UNIQUE Constraints in SQL Here is an in-depth look at an underused constraint, UNIQUE, that can increase the performance of queries and protect data... 10 January 2013 22 min read
Joe Celko Row Sorting in SQL It should be easy to model a game of poker in SQL. The problem is, however, that you need to... 30 November 2012 10 min read
Joe Celko Matrix Math in SQL Relational Databases have tables as data structures, not arrays. This makes it tricky and slow to do matrix operations, but... 17 September 2012 10 min read
Greg Lucas Test-driven Database Development – Why tSQLt? Test-Driven Development (TDD) has a good track record in application development, but is less well-established in database development work. This... 21 August 2012 16 min read