Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Table design: DataType to use for storing Binary Data '100100100010000' Expand / Collapse
Author
Message
Posted Monday, August 2, 2010 5:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 3:04 PM
Points: 5, Visits: 38
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
Post #962098
Posted Monday, August 2, 2010 5:52 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, December 19, 2010 10:52 PM
Points: 30, Visits: 213
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
www.sqlinfo.in
Post #962102
Posted Monday, August 2, 2010 6:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 3:04 PM
Points: 5, Visits: 38
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
Post #962128
Posted Monday, August 2, 2010 6:39 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, May 15, 2014 8:31 AM
Points: 419, Visits: 725
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.
Post #962131
Posted Monday, August 2, 2010 9:44 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, December 19, 2010 10:52 PM
Points: 30, Visits: 213
Hi sarath,

Store it as varchar in DB









Regards
Varun R
Post #962572
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse