Articles tagged

07 October 2019
07 October 2019

SQL and Scope

Understanding scoping rules is a basic skill for developers. In this article, Joe Celko gives a bit of the history of scoping in early programming languages and shows how scoping applies to SQL queries as well. … Read more
13 March 2019
13 March 2019

Converting a History Table into a System-Versioned Temporal Table

Temporal tables were introduced with SQL Server 2016. To take advantage of this feature, you might start fresh with a brand new table. It is possible, however, to convert an existing table with accumulated history to the new functionality. In this article, Mala Mahadevan explains how to create temporal tables for both scenarios.… Read more
10 January 2019
10 January 2019

Empty Thoughts: Working with NULL

Whether or not to have NULLable columns in a table can be a religious debate, and how missing data is represented should be carefully considered during database design. In this article, Joe Celko considers the ways that SQL Server handles NULLs in several situations. … Read more
09 January 2019
09 January 2019

SQL naming conventions

23
SQL naming conventions for tables, and all the associated objects such as indexes, constraints, keys and triggers, are important for teamwork. Poorly-named tables and other objects make it difficult to maintain databases. Table names must follow the rules for SQL Server identifiers, and be less than 128 characters. It is possible to force SQL Server to … Read more
05 September 2018
05 September 2018

Using WITH in an IF Condition

11
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