开发者

Sensible use of SQL Server 2008 FileStream?

开发者 https://www.devze.com 2023-01-03 21:20 出处:网络
I have an ASP.NET MVC application and I want to embed on each page some help content. This will be HTML pages that will be loaded into a dialog or new browser page (to be decided). Obviously I could s

I have an ASP.NET MVC application and I want to embed on each page some help content. This will be HTML pages that will be loaded into a dialog or new browser page (to be decided). Obviously I could store this in a max text field in the DB, but I also think I could store it in a FileStream. This sounds appealing to me as it would allow my devs to edit the HTML without requiring a special tool that can access the DB content.

Assu开发者_运维技巧ming this HTML is not going to be massive, is this a sensible use of a Filestream or should I simply use a regular text column?


This is not how Filestream works - you cannot modify the files without going through the database. That would be equivalent to editing .mdf files - effectively corrupting the database.

Also keep in mind that unless your HTML files are at least 500 KiB in size (unlikely for HTML files), you may achieve better performance storing them inside the database (e.g. in nvarchar(max) columns).

0

精彩评论

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