哪些数据类型存储图像和文件在SQL Server 2005 [英] Which data-type for storing images and documents in SQL Server 2005

查看:162
本文介绍了哪些数据类型存储图像和文件在SQL Server 2005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须扩展现有的.NET应用程序存储在SQL Server图像和文档(主要是PDF格式的)2005数据库。

I must extend an existing .net-Application to store images and documents (mostly pdf's) in a SQL Server 2005 database.

哪个SQL Server的数据类型用于最佳保存这些文件和是它meaningfull来创建包含字段,或者是它没有问题的,直接的正常业务表中把这些字段一个单独的表,只要select语句不选择它们(或SELECT *)。

Which SQL Server datatype is used best for saving these files and is it meaningfull to create a separate table that holds the fields, or is it no problem to put these fields directly in the "normal" business tables, as long as the select statements do not select them (or SELECT *).

推荐答案

VARBINARY或FILESTREAM

VARBINARY or FILESTREAM

没有必要将它们存储在一个单独的表 - 有内置控件,你可以用它来强制使用sp_tableoption存储在输入/输出的行:

No need to store them in a separate table - there are built-in controls you can use to force it to be stored in/out of row using sp_tableoption:

http://msdn.microsoft.com/en-us/library/ ms189087.aspx

http://msdn.microsoft.com/en-us/library/ ms186981.aspx

http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-manage-unstructured.aspx

(注意,有可能是利益,在一个单独的表中存储,如果你使用的是不同的文件组,并在备份单独或类似的东西 - 但是这可能被视为例外)

(Note that there might be benefits to storing in a separate table if you are using different filegroups and backing them up independently or something like that - but that might be considered exceptional)

这篇关于哪些数据类型存储图像和文件在SQL Server 2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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