A stack of coins

How SQL Server stores data types: money

In this post we look at how SQL Server stores currency values using the MONEY and SMALLMONEY data types. If you’d like to read the previous posts in this series of how SQL Server stores data types, here’s what we’ve got so far: Bit columns Dates and times Integers and decimals 🎶 It’s a rich
-> Continue reading How SQL Server stores data types: money

Blue number notebook

How SQL Server stores data types: integers and decimals

This week we’re going to look at how numbers are stored. This post will cover integers (TINYINT, SMALLINT, INT, BIGINT), and decimals (DECIMAL, which is the same as NUMERIC). If you’d like to read the previous posts in this series of how SQL Server stores data types, here’s what we’ve covered: Bit columns Dates and
-> Continue reading How SQL Server stores data types: integers and decimals

Calculator on written page

Negative identity values don’t suck

A quick(er) post this week, in response to Greg Low’s blog post from a few weeks ago titled “Don’t start identity columns or sequences with large negative values.” Greg writes that you shouldn’t use large negative values in a table, because… it’s hard to read them, I guess? And also they don’t compress well. I
-> Continue reading Negative identity values don’t suck

PASS Summit 2020 pre-con time

In 2018, I entered Speaker Idol at the PASS Summit, and because I forgot to start my timer I was disqualified for running over the five-minute limit (say “five-minute limit” fast ten times in a row). I also took part in promotion for a book my friend Melody spearheaded, where all proceeds went to charity.
-> Continue reading PASS Summit 2020 pre-con time

brown and white clocks

How SQL Server stores data types: dates and times

This post dives into how SQL Server stores date and time data types in memory and on disk. But first, a note about endianness: CPUs manufactured by Intel and other vendors process binary values in reverse order (known as little-endian), with the least significant byte in a binary value first, and the most significant (i.e.
-> Continue reading How SQL Server stores data types: dates and times

WUT?

Remember this if you want to use sp_

Erik Darling, of Erik Darling Data (blog | Twitter) recently posted a very interesting video (my YouTube playlist is all Erik Darling Data videos and Honest Trailers). In this video he demonstrates an easily repeatable issue about naming weirdness and the CREATE OR ALTER PROCEDURE syntax, with stored procedures starting with sp_. The video is
-> Continue reading Remember this if you want to use sp_

Adelaide SQL Server User Group

Join me (virtually) in Adelaide!

I will be presenting a session to the Adelaide SQL Server User Group on April 15th, 2020, and if you’re awake at that time (it’ll be 9pm on April 14th for me), you’re welcome to join in. You can register on EventBrite using the link https://www.eventbrite.com.au/e/adelaide-data-analytics-user-group-with-randolph-west-tickets-101490246058. The topic is a “virtualized” variation of the session
-> Continue reading Join me (virtually) in Adelaide!

macro shot of stainless steel padlock

Picking up the pieces after the DBA has left: taking ownership of a SQL Server instance

WARNING: This post contains information that can get you fired if you use it without express written permission. In some jurisdictions it might get you jail time as well. Let’s assume you are a consultant, and a customer has called you in a panic because they have lost access to their production environment. Let’s assume
-> Continue reading Picking up the pieces after the DBA has left: taking ownership of a SQL Server instance

sql2xls goes cross-platform

Last year I released sql2xls, a free open-source tool which lets you throw a bunch of scripts into a folder, run them automatically against SQL Server and get the results back in a nicely-formatted Excel file, one tab per script. A year later, I am happy to announce that the tool now runs cross-platform. You
-> Continue reading sql2xls goes cross-platform