We had an entire system based on SQL Server's "FOR XML" output clause and XML data islands in IE. It was an unmitigated fucking disaster zone that took 5 years to get rid of.
That put us off the above pretty sharpish.
FOR XML and XML data type (e.g. XML column) are pretty much unrelated.
Yep but they share one feature: shitty idea.
I was on the dev team that put together the XML data type support in SQL Server. We had bigger dreams back then, and I still do. :)
I don't think you should feel bad about that.
Though if you were using Postgres instead of MSSQL, you would probably consider JSON (or HSTORE) instead of XML since Postgres 9.2 has a built-in JSON column type.
Re:XML for databases: a dead idea
by fusiongyro on Tuesday January 15, 2013 @11:50AM
(#5061167)
Postgres has had an XML type for a lot longer than that. There's also better built-in support for XML than JSON because it's been in there longer.
Believe it or not it was extremely fast...but only after playing with the xml format for awhile and making sure the indexes all fit nicely. You can, almost surprisingly, index specific XML fields inside of xml data-type columns[2].
I can almost hear you all cringing after reading that :)
[1] http://msdn.microsoft.com/en-us/library/ms190936(v=sql.90).a... [2] http://msdn.microsoft.com/en-us/library/ms191497(v=sql.90).a...