SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
sarathcd
sarathcd
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 42
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
varunfilim
varunfilim
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 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
sarathcd
sarathcd
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 42
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
jvanderberg
jvanderberg
Say Hey Kid
Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)Say Hey Kid (680 reputation)

Group: General Forum Members
Points: 680 Visits: 746
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.
varunfilim
varunfilim
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 213
Hi sarath,

Store it as varchar in DB









Regards
Varun R
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search