Post image

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 feature. That’s why SQL Server (and other RDBMS products in the market) keep as much of the data in memory[…]

Post image

Update your production servers and stop making excuses about it

Folks, we all like to make sure we’re doing our level best to make things work smoothly. So why am I staring at someone’s server that has never been updated since it was first set up almost three years ago? Do better, so that I don’t have to yell at you. Seriously. When we ignore[…]

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 integer, DATENAME returns the part as a character string. This DATENAME function also takes two parameters: the date or time[…]

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 week we’ll go through one of them and see how it works. Introducing DATEPART, a built-in function that takes two[…]

Dates and Times in SQL Server: the problem with DATETIME

Recently I wrote a post about date and time functions you should never use, which contained an opinion I’ve expressed previously that some people have disagreed with, namely that DATETIME is a terrible data type which you should not be using in new development. The motivation for this position is that a better data type exists. As[…]

Virtual Log Files: 200 or 1000?

Last week I had the privilege of reviewing possibly the best SQL Server production environment I’ve seen in Canada. During the follow-up meeting, the senior DBA and I had a discussion about Virtual Log Files (VLFs), disagreeing on the maximum number of Virtual Log Files a transaction log should have. I said 200, he said[…]

Dates and Times in SQL Server: more functions you should never use

Previously we looked at four built-in functions to get the current date and time in SQL Server and Azure SQL Database using Transact-SQL (T-SQL). We identified that out of the options provided, SYSUTCDATETIME() is the recommended method because it relies on Coordinated Universal Time (UTC), and uses the DATETIME2 data type which has a much higher[…]