Skip to content

Flagrantly ignoring the 10% rule

  • by

My friend Michael J. Swart has a rule of thumb he calls Swart’s Ten Percent Rule. If you’re using over 10% of what SQL Server restricts you to, you’re doing it wrong. After a recent… 

Dates and Times in SQL Server: DATEADD()

  • by

We are now in the home stretch of the long-running series about dates and times in SQL Server and Azure SQL Database. This week we look at one of my favourite T-SQL functions when it… 

Dates and Times in SQL Server: AT TIME ZONE

  • by

Continuing the series on dates and times in SQL Server and Azure SQL Database, this week we look at the hint AT TIME ZONE. In Azure SQL Database, the regional settings of the database are… 

Relational databases aren’t the problem

  • by

Content warning: This is the first of two rebuttal essays, about why someone is wrong on the Internet. It is no doubt biased. It might go into technical detail. Parts of it may be wrong.… 

messy paint

Why you should not use SELECT *

  • by

A shorter post this week, but an important one. Last week, Erik Darling commented on my post saying that we shouldn’t use SELECT *, which was both amusing and accurate. Amusing, because a number of… 

teacher at whiteboard

Don’t do these things in SQL Server

  • by

Recently Brent Ozar posted a link to the PostgreSQL “Don’t do this” page, which I am shamelessly reproducing below, re-tailored for a SQL Server audience. Don’t use -P with sqlcmd sqlcmd is a cross-platform interactive… 

Performance as a feature, software developer edition

Relational database management systems (RDBMS) like SQL Server and Azure SQL Database are very good at managing normalized data. Efficient storage and retrieval of data is the name of the game, so performance is a… 

Dates and Times in SQL Server: DATENAME()

Last time we looked at DATEPART(). This post is all about the DATENAME() function. So many similarities There are many similarities between DATEPART and DATENAME. Where DATEPART returns the date or time part as an… 

calendar

Dates and Times in SQL Server: DATEPART()

In my previous posts in this series we’ve seen reference to Transact-SQL (T-SQL) functions that are used to get the specific part of a date and/or time (year, month, day, hour, minute, second, etc.). This… 

T-SQL aside: replace PRINT with RAISERROR

I was minding my own business innocently reading a blog post by Erik Darling, when this tip smacked me in the proverbial forehead. I even learned something that had always bothered me but had been…