Expected XML schema document
By the error message I guess you didn't use a valid XSD to create the collection. How does your XSD look like; you posted only a very small part of it?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, got metadata xml file https://pastebin.com/sbT4X6uC
My need is to parse it into SQL DDL script(s) w/ FK.
I'm trying to use it with
CREATE XML SCHEMA COLLECTION ManuInstructionsSchemaCollection AS
N' <?xml ... >';
But getting
Error invoking remote method 'DB_EXECUTE_CANCELLABLE_QUERY': RequestError: Expected XML schema document
Is there anything I can do to fix it so that I can use "create xml schema collection"? Or is there any other known way to extract SQL DDL w/ FK? Or at least just SQL DDL w/o FK?
Please advise.
Expected XML schema document
By the error message I guess you didn't use a valid XSD to create the collection. How does your XSD look like; you posted only a very small part of it?
Hi wnd-4239,
Welcome to Microsoft Q&A.
The database has constraints and schema elements which can enforce the logical correctness of the data. Unlike the database, there is nothing built into a text editor to prevent errors when creating an XML Document. For the XML, this has to be defined separately in an XSD document. The XSD itself is in an XML language and is therefore also both human readable and somewhat self descriptive. Please refer to this doc and this article which might help.
Or is there any other known way to extract SQL DDL w/ FK?
We can use the Generate Scripts wizard create scripts for DDL with FK. Please right-click database ->Tasks-> select Generate Scripts.
Then we can select specific objects in Choose Objects page to choose which objects you want to include in the scripts.
Please refer to this tutorial which might help.
Best Regards,
Amelia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
HI anonymous user-4239,
EDMX is Visual Studio's "container" for the metadata about your Entity Data Model.
An .edmx file is an XML file that defines the following:
The EDMX visual designer has a options available from its right-click context menu: "update model from database", and also "Generate database from model".
It is done based on a storage model.
MS official documentation: Entity Data Model for Data Services Packaging Format