Storing 64 bit numbers in SQL Server 7

  • Hello, I am trying to find a way of storing a 64 bit number in SQL Server 7.  The apparent absence of the Bigint data type available in SQL 2000 is a worry.  Does anyone know how this could be done (maybe using float?).  Any suggestions would be appreciated.

    Thanks

    Graham

  • Try:

    DECLARE @bigInt decimal(38,0)

    SET @bigint = 65536.0 * 65536 * 65536 * 65536

    -- or

    -- SET @bigint = Cast(65536 as Dec(38,0)) * 65536 * 65536 * 65536

    PRINT @bigInt

  • Depending on your needs, you could store a 16 character hexadecimal string value, which your application could encode and decode as needed...

  • Sorry for the delay.  Thanks for your suggestions, both of which are useful. 

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply