Table design: DataType to use for storing Binary Data '100100100010000'

  • Hi,

    I would like to store binary data (i.e) '100100100010000' of length more than 500 and fixed for the column.

    Can anyone tell me what are the DataTypes that I can use for this to design the table and also the best one to apply?

    We have designed the table with Char datatype but the client wants an alternative.

    I have tried with Binary and VarBinary datatype. But these datatypes store the information only as Hexadecimal values.

    I need some help on this very urgently,

    Thanks,

    Sarath

  • Hi sarath,

    I think you can use Bigint,As u told the remaining datatypes like varbinary and binary will give hexadecimal values.

    Regards

    Varun R

    http://www.sqlinfo.in

  • Varun,

    Thanks for your reply, but the data I wish to store has to be retained in the same format even if the values preced with 0 (e.g) 0000000001010000010.

    And also bigint ranges from -9223372036854775808 through 9223372036854775807. Length of the data I have to store is more than 500 characters.

    regards

    Sarath

  • I think your best bet is VARBINARY. You'll need something like a user-defined function to convert to and from the datatype, but there really isn't a better datatype for storing binary data greater than 64 bits.

  • Hi sarath,

    Store it as varchar in DB

    Regards

    Varun R

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

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