Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Use of Offset

Author  Topic 

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2008-08-21 : 03:45:58
I was reading this http://en.wikipedia.org/wiki/Offset_(computer_science)

I know it's a well used concept. But I'm not quite sure on what it's practical value is. Even in a SQL data page, offsets get used. How does it help with anything?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-08-21 : 04:29:32
well roughly a page in sql server 2005 first has static length datatypes then variable length datatypes stored.
you can think of this as an array A[8000]. now the offset tells you on which index the correct data column starts.
so for example if you have 2 columns char(6) and bit
the offsets would be 0 and 6
A[0] to A[5] is char while A[6] is bit

any clearer?


_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2008-08-21 : 18:42:44
So it gets used as a shortcut basically?
Go to Top of Page
   

- Advertisement -