Bagikan melalui


Starting Team Development of Databases that Use XML Schema Collections

XML schema collections can be difficult to work with if they are all defined inline in your database code. You can instead add a reference in your database project to an XML schema definition (XSD) file that contains the definition of the XML schema collection that you want to use. You can then use the collection in your table definitions. For more information, see this topic on the Microsoft Web site: Implementing XML in SQL Server.

Importing Database Objects and Settings

If you import the objects and settings for a database, any XML schema collections are defined inline in an XML schema collection object. You can find that object in Schema View in the Programmability category. If you want to instead add a reference to an XSD file, you must delete that object definition and then add the reference to your database project. You should add the XSD file to version control and consider adding the file to your database project.

Common Tasks

In the following table, you can find descriptions of common tasks that support this scenario and links to more information about how you can successfully complete those tasks:

Common Tasks

Supporting Content

Learn more about database projects: You can read about the basic concepts of how to manage schema changes by using database projects.

Get hands-on practice: You can follow an introductory walkthrough to become familiar with how to create and deploy changes to a database project that references an XSD file.

Put an existing database schema under version control: You can create a project, configure project settings, and import a schema by using the database project wizard. You can also create an empty project if you want to import the schema later or if you do not have permission to access the database from which you want to import the schema. After you import the schema, you can add the project to version control and add a reference to an XSD file that contains the definition of an XML schema collection.