最有效的方式来存储20梅格文件在SQL Server 2005 image列 [英] Most efficient way to store a 20 Meg file in a SQL Server 2005 IMAGE Column

查看:106
本文介绍了最有效的方式来存储20梅格文件在SQL Server 2005 image列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们存储在以形象一栏格式的SQL Server 2005数据库表的文档。

We store documents in an SQL Server 2005 database table with a column format of "Image".

每次我尝试保存为PDF文件,该文件是大于1梅格,它在某种程度上被损坏。

Every time I try to store a PDF file which is greater than 1 Meg, it somehow gets corrupted.

是否有任何.NET特别有效的方法序列化和存储大文件(〜10megs)到数据库?

Is there any particularly efficient method in .NET to serialize and store large files (~10megs) into a database?


实际上微软表示,最大文件大小约为2G
可变长度的二进制数据,从0到2 ^ 31-1(2,147,483,647)字节。
http://msdn.microsoft.com/en-us/library /ms187993.aspx

推荐答案

如果你不想重构你的文档了分贝的快速解决方案在这一点上是对数据使用压缩:

A quick solution if you don't want to refactor your documents out of the db at this point is to use compression on your data:

http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx

我怀疑SQL Server正在破坏你的文件,但在gzip算法工作可能会帮助您发现错误。

i doubt that Sql Server is corrupting your files but working in the gzip algorithm might help you find a bug.

这篇关于最有效的方式来存储20梅格文件在SQL Server 2005 image列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆