• Check if you can find this function in master database on SQL2005.

    But this works on SQL 2008:

    Declare @hex VARCHAR(50)

    Select @hex = '0x' + '009FF000' -- I added missing zero in front of the string

    SELECT Convert(Int, 0x09FF000) , CONVERT(Int, substring([sys].[fn_cdc_hexstrtobin](@hex), 1,4)), [sys].[fn_cdc_hexstrtobin](@hex)

    _____________
    Code for TallyGenerator