Is it “bad” to store XML in a database?

后端 未结 7 1525
感动是毒
感动是毒 2021-02-02 11:06

I have heard from several sources that storing XML in a database is \"bad\", but I have never seen/heard an actual explanation of why that is. Is it true? If it is true, can y

7条回答
  •  既然无缘
    2021-02-02 12:05

    It's not bad at all. Microsoft SQL Server has an XML data type. One use case for storing XML is a situation we found ourselves in. For each row in a particular table, we needed to store a variable number of attributes related to that row. And the number of these attributes can change over time, and with each row. We found it more efficient to store these attributes, and their values in an XML format. In the future, each time we adjust the number of attributes, we don't need to make schema changes.

提交回复
热议问题