Assorted coin lot in clear glass jar

How should I store currency values in SQL Server?

On Twitter, Michael Dyrynda writes: ⚠️ Never ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever store currency as
-> Continue reading How should I store currency values in SQL Server?

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

Post image

Data Efficiency in SQL Server: DECIMAL

This is part two of a short series of posts about how I assign efficient data types when designing a new table or database. Use less space with BIGINT Last week, I spoke about a more efficient DATETIME than DATETIME. This week I have a more efficient DECIMAL than DECIMAL. If you’re planning to store
-> Continue reading Data Efficiency in SQL Server: DECIMAL