Database Reference
In-Depth Information
(
'SqlServerInternals' /*Database Name*/
,1 /*File ID*/
,214643 /*Page ID*/
,3 /*Output mode: 3 - display page header and row details */
);
Listing 1-6 shows the output of the DBCC PAGE that corresponds to the first data row. SQL Server stores the data in
byte-swapped order. For example, a two-byte value of 0001 would be stored as 0100 .
Listing 1-6. DBCC PAGE output for the first row
Slot 0 Offset 0x60 Length 39
Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS
Record Size = 39
Memory Dump @0x000000000EABA060
0000000000000000: 30000800 01000000 04000403 001d001d 00270061 0................'.a
0000000000000014: 61616161 61616161 61636363 63636363 636363 aaaaaaaaacccccccccc
Slot 0 Column 1 Offset 0x4 Length 4 Length (physical) 4
ID = 1
Slot 0 Column 2 Offset 0x13 Length 10 Length (physical) 10
Col1 = aaaaaaaaaa
Slot 0 Column 3 Offset 0x0 Length 0 Length (physical) 0
Col2 = [NULL]
Slot 0 Column 4 Offset 0x1d Length 10 Length (physical) 10
Col3 = cccccccccc
Let's look at the data row in more detail, as shown in Figure 1-8 .
Figure 1-8. First data row
As you see, the row starts with the two status bits followed by a two-byte value of 0800 . This is the byte-swapped
value of 0008 , which is the offset for the number of columns attribute in the row. This offset tells SQL Server where the
fixed-length data part of the row ends.
Search WWH ::




Custom Search