In this article I look at how the datetimeoffset data type is stored in SQL Server, and how you can get different reported storage size results, depending on what you’re doing with it.
This is similar to what I did with the datetime2 data type.
In particular, I look at the following:
- Microsoft’s documentation
- Data stored in a variable
- Length in bytes using
DATALENGTH()
- Length in bytes using
DATALENGTH()
after converting to varbinary
- Length in bytes using
- Data stored in a database
- Length in bytes using
COL_LENGTH()
- Length in bytes using
DBCC PAGE()
- Length in bytes using