Is there a way to apply a schema to an xml column to type values such as Date, int, decimal, etc? Also, when querying the contents with XPath is there a way to do check against the actual type and not its string value?
Should we even try this, is there a performance hit with doing raw string checks for these values, or should we even be concerned with this approach?
XML schema for SQL Server XML column – yes, absolutely. What you’ll need to do is create a schema collection (you can have multiple schemas in a collection)
and then when you define the XML column, you need to reference that XML schema collection to bind” the XML column to that schema collection:
The XPath thing – not sure, but I don’t think so – XML really is nothing but strings in the end, right?
Marc