locked
What datatype is best for storing html? RRS feed

  • Question

  • I'm thinking about trying to store some html in a sql server db.  Is the varchar the best type to use?  


    Sunday, November 22, 2009 9:25 PM

Answers

  • I would think so and probably nvarchar(max).
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    Sunday, November 22, 2009 9:58 PM
  • VARCHAR, NVARCHAR, and XML can work, depending on your requirements. But lile Naom said, prob ably NVARCHAR because it supports foreign characters, and unlike XML doesn't care if the XML is valid or not.
    Monday, November 23, 2009 2:41 PM

All replies

  • I would think so and probably nvarchar(max).
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    Sunday, November 22, 2009 9:58 PM
  • VARCHAR, NVARCHAR, and XML can work, depending on your requirements. But lile Naom said, prob ably NVARCHAR because it supports foreign characters, and unlike XML doesn't care if the XML is valid or not.
    Monday, November 23, 2009 2:41 PM