问一个菜鸟的问题:SQL server 存储图片采用什么字段比较好?
------解决思路----------------------
不要把图片存数据库里面,把图片存到硬盘上去,数据库只存地址,然后,建议VARCHAR格式
------解决思路----------------------
微软研究院的一篇paper,可以免费下载:
http://research.microsoft.com/apps/pubs/default.aspx?id=64525
主要结论:
(1) if your pictures or document are typically below 256K in size, storing them in a database VARBINARY column is more efficient
(2)if your pictures or document are typically over 1 MB in size, storing them in the filesystem is more efficient (and with SQL Server 2008's FILESTREAM attribute, they're still under transactional control and part of the database)
in between those two, it's a bit of a toss-up depending on your use
------解决思路----------------------
一般不建议存储在数据库里面,如果要使用数据库存储,建议使用 FILESTREAM ,楼主百度一下吧。
------解决思路----------------------
图片就不要存到数据库了!
存图片名称,图片存储到文件服务器,程序上传、下载以及访问都用http