SQL Server 2000 - insert

  • How to insert a HTML format contents in a field?

    (ie. with all the tags, single quotes, double quotes etc..)

  • One of the advantages of HTML is that, ultimately, it's just text.

    If it's going to be less than 8000 characters, store it in a varchar field.

    If it's going to extend beyond that, store it in a text field.

    If you're going to be doing work with it doing dynamic SQL, look into QUOTENAME and QUOTED_IDENTIFIER (and related topics) in BOL.

    Otherwise, there's really nothing different about it.

  • I know you're using 8, but as a related point, v9 has an XML data type. No doubt I will be corrected if not, but I think HTML can be validated against an XML schema and stored in that way. I don't know that much about it, does anyone else have any more info?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • I know you're using 8, but as a related point, v9 has an XML data type. No doubt I will be corrected if not, but I think HTML can be validated against an XML schema and stored in that way. I don't know that much about it, does anyone else have any more info?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply