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 data The fun of exploring problems such as Gaps and Islands is all the greater when we have a test-harness to... 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 Getting Started Testing Databases with tSQLt There are several frameworks for assisting with the testing of SQL Server databases, but tSQLt is popular because it is... 08 April 2013 22 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
Seth Delconte NULL-Friendly: Using Sparse Columns and Column Sets in SQL Server Sparse columns and column sets in SQL Server 2012 provide a way of accomodating the less-structured data that has always... 10 July 2012 14 min read
Phil Factor Handling Constraint Violations and Errors in SQL Server The database developer can, of course, throw all errors back to the application developer to deal with, but this is... 29 June 2012 27 min read