开发者

A question regarding DB Images -

A Clarification, if I have a table that has the following fields....

ProductCategoryID, CategoryName, Image1, Image2, Image3, Image4 and Image5 have data types varbinary(MAX) and ImageMimeType has data type varchar(50). What would be the difference if I have two tables as the following...

(for simplicity sake) Table One - ProductCategoryID, CategoryName

Table Two - ProductCategoryID, ImageID, Image1, Image2, Image3, Image4 Image5 ImageMimeType

I read somewhere images should be placed in 开发者_开发知识库separate table for performance & corruption prevention. Or it doesn't matter? Is there pro's & cons? I am using ASP.NET MVC3 C#, SQL SERVER 2008R2.

Thanks


If the images are large, consider configuring your database to store files using Filestream. That may make a big difference. Having the image columns in different tables won't matter then, because they'll be stored in different a filegroup. That said, you should always normalize as you see fit. Some info on Filestream:

http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx http://www.aghausman.net/sql_server/configure-sql-server-2008-for-file-stream-2.html http://msdn.microsoft.com/en-us/library/ms144259.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜