EightKB logo

Join me at the EightKB virtual conference on 28 July 2021

Next week on Wednesday 28 July 2021, I will be presenting a brand-new session titled “How SQL Server stores that data type” for the free EightKB virtual conference. I’ve made it a 500-level talk, as reading hex and binary for fun requires a bit of mental arithmetic. Bob Ward, famous for his half-day brain-melting sessions
-> Continue reading Join me at the EightKB virtual conference on 28 July 2021

analogue clock with a blur effect on the minutes

How SQL Server stores data types: DATETIMEOFFSET

If you’d like to check out the previous instalment in this series on storing dates and times, click here. I avoided mentioning this data type because I didn’t think a lot of people used it, and then my co-author William Assaf (blog | Twitter) told me on Twitter that he uses it, so here we
-> Continue reading How SQL Server stores data types: DATETIMEOFFSET

SQL Server 2008 R2 logo

T-SQL Tuesday Retrospective #007: Summertime in the SQL

This is the seventh post in my retrospective attempt to answer every T-SQL Tuesday invitation. In the beginning of June 2010, Jorge Segarra invited us to write about our favourite hot new feature in SQL Server 2008 or 2008 R2. For me, this would be the introduction of the DATE, TIME, and DATETIME2 data types
-> Continue reading T-SQL Tuesday Retrospective #007: Summertime in the SQL

messy paint cans and colours

How SQL Server stores data types: sql_variant

This post looks at a curious data type that isn’t really a data type. Instead, sql_variant tries to be all things to all people. As with most things in life, it has a few shortcomings as a result. If you would like to read about storage of other data types, here are the previous posts
-> Continue reading How SQL Server stores data types: sql_variant

A half-closed MacBook

How SQL Server stores data types: XML

This week we’re looking at how the database engine stores the XML data type in SQL Server and Azure SQL Database. If you would like to read about storage of other data types, here are the previous posts in the series: Bit columns Dates and times Integers and decimals Money Floating points GUIDs What is XML?
-> Continue reading How SQL Server stores data types: XML

A wall of scattered pages from a book

The final word on storage for DATETIME2

Two years ago I wrote a post that got a lot of traction in the comments at the time. Last month there was renewed interest because one of the commenters noted that the official SQL Server documentation for DATETIME2 disagreed with my assertions, and that I was under-representing the storage requirements. To remind you, I
-> Continue reading The final word on storage for DATETIME2

A random selection of tools

How SQL Server stores data types: UNIQUEIDENTIFIER

This week we’re looking at how the database engine stores GUIDs (globally unique identifiers), specifically known as UNIQUEIDENTIFIER in SQL Server. If you would like to read about storage of other data types, here are the previous posts in the series: Bit columns Dates and times Integers and decimals Money Floating points What is a
-> Continue reading How SQL Server stores data types: UNIQUEIDENTIFIER

Black and white Texas Instruments calculator

How SQL Server stores data types: floating points

In this post we are looking at how SQL Server stores floating point values (FLOAT and REAL). If you’d like to read the previous posts in this series of how SQL Server stores data types, you can do so here: Bit columns Dates and times Integers and decimals Money Floating point values If an integer
-> Continue reading How SQL Server stores data types: floating points

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