June 29, 2009 at 8:39 am
Can any one help me out with the best way to store a zip file in the column of a table in SQL Server 2005.The size of each of the zip files would be around 2MB.
Thanks in advance.
June 29, 2009 at 8:49 am
Check out the following article:
http://www.sqlservercentral.com/articles/storingandretrievingbinarydatainsqlserver/359/
June 30, 2009 at 9:30 pm
I checked out the article in the other posters response and generally disagree.
As I see your question I see two parts, the first is definition, the field should be defined as varbinary(max), this is done for compatibility reasons, MS says the image type is going away and the replacement is varbinary(max). The second is where do you get the binary image? Now if it is available from the calling application then you can just do an insert, if you need to pull it up off the disk then the best way (my view) is to write a SQLCLR sproc to retrieve the binary image and write it to the table. Or a SQLCLR sproc that returns the binary image from the disk to the caller and the caller writes it to disk. Either way the code to retrieve a binary image into a byte() data type in .net is readily available. I have done this before but the code is not mine to give away.. But the concepts I can..
CEWII
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply