Articles tagged

05 September 2018
05 September 2018

Using WITH in an IF Condition

12
I am in the middle of working on my DB Design conference that occurs in a bit over a week from now. But I had this come up in some work I was doing and wanted to put it down in a blog. One of the most exciting features of SQL Server 2005 was the … Read more
05 May 2018
05 May 2018

Who comments code?

8
I am a firm advocate of commenting code, but you need to make sure that you are commenting the right thing.  I worked on a project last year and then the project was paused.  I’m now back on it full time, some 6 months later.  I wrote most of the database code and all calls … Read more
18 April 2018
18 April 2018

Finding overlapping ranges of data

9
This week, I had a problem where I needed to find and eliminate from the results of my query, data with overlapping ranges. I have written about this topic before, in my database design book book, in regards to building a trigger to avoid overlapping ranges. But even though I have written on the topic … Read more
10 April 2018
10 April 2018

SQL Server Closure Tables

SQL Server has a couple of different ways to represent hierarchies, but they do not allow storing any additional information that is important to the relationship between objects. In this article, Phil Factor explains how to use closure tables to overcome this deficiency.… Read more
08 April 2018
08 April 2018

SQL Code Smells

Some time ago, Phil Factor wrote his booklet 'SQL Code Smells', collecting together a whole range of SQL Coding practices that could be considered to indicate the need for a review of the code. It was published as 119 code smells, even though there were 120 of them at the time. Phil Factor has continued to collect them and the current state of the art is reflected in this article. SQL Prompt is committed to cover as many as possible of them. Phil has also updated his book which you can download here.… Read more