What database field type should I use to store web pages (html, pdf, text) files in the same field? nvarchar(max)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’d want to use
VARBINARY(MAX)orNVARCHAR(MAX), depending on the type of data being stored and what you want to do with it. If you going to store files (which it sounds like, especially with mixed extensions), useVARBINARY(MAX). You can full-text index off that data type too — although PDF’s require an additional iFilter (at least it did with our SQL Server 2005 instance — it may be there by default in 2008).Keep in mind that you don’t want to use IMAGE, as that data type (along with TEXT and NTEXT) is deprecated and is being removed in a future version of SQL Server. Here’s the link about that.
Hope this helps.