Click here to Skip to main content
15,914,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello everyone
using Microsoft SQL.
what datatype should i use for a byte array data. thank you
Posted

You could use either binary or varbinary for this purpose.
 
Share this answer
 
Comments
Wendelius 28-Dec-11 13:29pm    
Yep, exactly , my 5.
I'd suggest varbinary for binary strings. This is the datatype that's going to be supported in future versions.
 
Share this answer
 
Comments
fjdiewornncalwe 28-Dec-11 13:30pm    
+5 to you as well. :)
Wendelius 28-Dec-11 13:35pm    
Thanks :)
Amir Mahfoozi 28-Dec-11 15:39pm    
So how about text and image data types. Is it going to something happen to them in the future ?
Wendelius 28-Dec-11 16:01pm    
Yep, MS is mos likely going to remove them. See: http://msdn.microsoft.com/en-us/library/ms187993(v=SQL.105).aspx[^]
Amir Mahfoozi 29-Dec-11 1:42am    
Thank you for informing me :)
binary(n) for fixed-length binary data of length and varbinary(max) which is used to store large binary values (BLOBs)

binary(n) variables store n bytes of fixed-size binary data. They may store a maximum of 8,000 bytes
varbinary(max) variables store variable-length binary data of approximately n bytes. They may store a maximum of 2 gigabytes.
Reference Link ;- Binary Data Types in SQL Server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900