Saving long parts in a database or file?

Developed by asp.net on the .NET Framework 4.0 and SQL SERVER 2008 . When my administrator saves project information with HTMLEditorExtender , where can I save it?

  • Can I save this in Database ? (varchar has 8000 characters). The detail may be large.
  • or in File ?

What is the best practice?
At the moment, I saved it in Files , because SQL Hosting has less DB space than Disk space .
If I saved it to File , then how to return formatted data (with images and links)?

Please give me a better way to follow. Thanks

+4
source share
1 answer

You can use VARCHAR(MAX) instead of VARCHAR(8000) - it can contain about 2 GB of data.

However, if you are saving HTML, consider using NVARCHAR(MAX) if the published data may contain Unicode characters (think of an international audience).

A Microsoft study has good information about storing files in and out of a database that makes good reading - In Blob or not in Blob .

+5
source

All Articles