By ronen ariely on
07/05/2015 14:17
In this blog I will show step by step how I examined the DateTime2 data, in order to find the actual storing format. The basic process is based on reverse engineer by examining the binary data that we get in CONVERT to VARBINARY(16)
-- check the data as binary show us the format behind the scenes:
DECLARE
@d DATETIME2 =
'2016-02-27 00:00:00.000'
-- My next birthday :-)
SELECT
CONVERT
(VARBINARY(16),@d)
GO
* Result: 0x070000000000143B0B
The goals in this blog are: (1) understand how DateTime2 stored in the database, (2) to provide a small glimpse on the process that we can use in order to examine what is going behind the scenes in the Page Data File (for specific data type).