• To convert from binary(6) to bigint, you can just use:

    CAST(0x5F0500000100 as bigint)

    You can cast from binary type to an integer type provided that you don't stray into negative numbers, which are stored using the top half of the binary range. Binary(6) can't fall into the range of binary values that represent negative bigints, so this will work OK.

    But sysindexes.first contains a pointer value, not a page ID, so you can't use this value for DBCC PAGE(). I'm not sure how you get page IDs - but DBCC IND(dbname|dbid, objname|objid, 1|2) will show you the index pages for a given table. The 3rd arg is 'print options' which affects how detailed the output is. I don't think this gives you page IDs usable with DBCC PAGE() either, though!

    Sorry these comments are a bit sketchy but I haven't time to look up the details.

    [edit: corrected (numerous!) typos]

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant