Moved to http://beyondrelational.com/blogs/jacob/archive/2009/03/17/practical-sql-server-xml-part-three.aspx
Great article! What if there were multiple errors when validating the XML document and I wanted to store the error code, attribute and value in a table so I can create an error report?
Hi Suhail,You can put your code into a TRY CATCH block and capture the ERROR_MESSAGE() which can then be inserted to a log table. For example:BEGIN TRY DECLARE @x XML(PersonSchema) SELECT @x = ' [Person] [PersonType]SC[/PersonType] [/Person]'END TRYBEGIN CATCH SELECT ERROR_MESSAGE()END CATCH Note: Please replace  with XML tags