• Eugene Elutin (5/9/2013)


    Why SQL has INT, SMALLINT etc, while it has DECIMAL which also can be used to stored integer values?

    I guess because DECIMAL (9,0) (same capacity as INT) takes twice as much storage space and N times more time for calculations, as it requires floating point arythmetics. 🙂

    In case of XML datatype it provides explicit validation that XML is in well-format form. Also, it allows you to enforce that your XML is compliant to the required schema (Typed XML).

    Also it provides "in-XML" indexing (full-text index kinda stuff), selecting subsets from XML data, reformatting XML and lots of other things.

    Which are wery expensive in terms of resourses, very time consuming and, strictly speaking, have nothing to do with relational database.

    But, on another hand, allow easy handling of small XML messages without spending time on developing numerous inerfaces for parsing XMLs and placing data into proper relational structure. Which (adding to the trouble) may change on very short notice. In such situation it's easier to alter the scema assocoated with XML column then redo database structure.

    In this case it makes sense to sacrifice computing resources of the server to gain flexibility.

    _____________
    Code for TallyGenerator