Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a stored procedure which creates xml content and then is stored to a xml file. Is it possible to validate the generated xml content against a dtd file?

Thank you in advance!

share|improve this question
up vote 1 down vote accepted

It is not possible to validate XML against a DTD file using SQL Server.

You can validate the XML with a XSD stored in a XML Schema Collection using a strong typed XML variable

DECLARE @x xml(YourXMLSchemaCollectionName);
SET @X = 'YourXML';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.