views:

23

answers:

2

Hi, I have a record which I viewed using DBCC page command. Here is how it looks :-

Memory Dump @0x00E5C060

00000000:   30000800 01000000 02000001 001f8000 †0...............         
00000010:   00d10700 0000009a 00000001 000000††††...............          

Slot 0 Column 0 Offset 0x4 Length 4

col1 = 1                             

col2 = [Textpointer] Slot 0 Column 1 Offset 0xf Length 16

TextTimeStamp = 131137536            RowId = (1:154:0)     

Here col1 is of type int and col2 is of type ntext.
I know that ntext column values are stored in text page.

But I don't know how to interpret col2 info above ie

col2 = [Textpointer] Slot 0 Column 1 Offset 0xf Length 16

TextTimeStamp = 131137536            RowId = (1:154:0)    

Can anybody help me understand this? Thanks

A: 

col2 is a pointer to the BLOB allocation unit. The ntext column is on slot 0 on the page (1:154). You can DBCC dump the page 1:154 to find the content of the ntext column col2.

There is a more detailed example at http://blogs.msdn.com/sqlserverstorageengine/archive/2006/12/13/More-undocumented-fun_3A00_-DBCC-IND_2C00_-DBCC-PAGE_2C00_-and-off_2D00_row-columns.aspx

Remus Rusanu
A: 

thanks for replying, "col2 = [Textpointer] Slot 0 Column 1 Offset 0xf Length 16"

00000000: 30000800 01000000 02000001 001f8000 †0...............
00000010: 00d10700 0000009a 00000001 000000††††...............

In this,its said that the length of info is 16. its equivalent hex values are : -

00 00d10700 0000009a 00000001 000000†††

i can find information about TextTimeStamp = 131137536 RowId = (1:154:0)

in the above hex values. But how can i find info that it is a text pointer

Moreover in another instance , i came accross [Inline Blob root] for an nvarchar datatype value.

heres how it looked

col6= [BLOB Inline Root] Slot 1 Column 38 Offset 0x16d Length 24

Level = 0 Unused = 0 UpdateSeq = 1 TimeStamp = 1969553408
Link 0

here if you notice the length is 24 in contrast to the previous instance (Text pointer) It has some additional information as well like update sequence is UpdateSeq = 1.

How can i differentiate between the two instance by looking at the sequence of bytes

jude
An inline BLOB is when the blob is kept inside the row allocation unit for a table that has `sp_tableoption 'text in row', ON`. The 24 length is the actual BLOB value itself.
Remus Rusanu
`00d10700 0000009a 00000001 000000`: 9a is 154, 1 is 1 and 0 is 0 so page (1:154:0) comes from the last 12 bytes (4 bytes, 4 bytes, 4 bytes). Not sure how the timestamp comes to be since 131137536 is 0x07D0A31C and I don't see that anywhere, but is of less importance. The iportant one is the page so you know where the BLOB starts. Why do you want to understand the page format so deeply?
Remus Rusanu
Btw Jude when you post an answer instead of a comment, you should also add a comment to my post. Otherwise I don't see that you added a reply. I wondered accross your new post only by pure chance.
Remus Rusanu