Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
Provides a set of visual tools for working with XML Schemas, ADO.NET datasets, and XML documents. The XML Designer supports the XML Schema Definition (XSD) language defined by the World Wide Web Consortium (WC3). The designer doesn't support DTDs (document type definitions) or other XML schema languages, such as XDR (XML-Data Reduced).
To display the designer, add a dataset, XML Schema, or XML file to your project or open any of the file types listed in the following table.
Caution
There's no Undo command when working in Schema view. Plan your work carefully and save your files often.
The designer provides the following three views (or modes) to work on XML files, XML Schemas, and datasets:
View | Description | File types supported |
---|---|---|
Schema | Visually create and modify XML Schemas and ADO.NET datasets. | .xsd |
Data | Visually modify XML data files in a structured data grid. | .xml |
XML | Edit XML; the source editor provides color-coding and IntelliSense, including complete word and list members. | .xml , .xsd , .xslt , .wsdl , .web , .resx , .tdl , .wsf , .hta , .disco , .vsdisco , .config |
ShowPlan | Displays XML query plans created using the SET SHOWPLAN_XML ON option. |
.showplan |
Schema view
Schema view provides a visual representation of the elements, attributes, types, and so on, that make up XML Schemas and ADO.NET datasets.
In Schema view you can construct schemas and datasets by dropping elements on the design surface from either the XML Schema tab of the Toolbox or from Server Explorer. Additionally, you can add elements to the designer by right-clicking the design surface and selecting Add from the shortcut menu.
In Schema view you can:
- Construct and modify existing XML Schemas and ADO.NET datasets
- Create and edit relationships between tables
- Create and edit keys
- Generate ADO.NET datasets from XML Schemas
Note
The layout of elements in Schema view is stored in the .xsx
file, which can be seen by selecting Show All Files in the Solution Explorer toolbar, and then expanding the .xsd
file. If there's no .xsx
file present, it means the .xsd
file was never opened in the XML Designer.
Customize Schema view
The following features modify the visual layout of elements in Schema view:
- Zooming
- Expanding or collapsing of nested elements
- Automatically arranging layout of elements
- Resetting default state of collapsed elements
Expand hidden nested elements
Select the plus icon on the bottom of the element.
Collapse nested elements
Select the minus icon on the bottom-most element that you want to appear on the designer.
Data view
Data view provides a data grid that can be used to modify .xml
files. Only the content (but not the tags and structure) in an XML file can be edited in Data view.
There are two separate areas in Data view: Data Tables and Data. The Data Tables area is a list of relations defined in the XML file, in the order of its nesting (from the outermost to the innermost). The Data area is a data grid that displays data based on the selection in the Data Tables area.
Note
Newly created XML files contain no data and therefore can't be displayed in Data view. There are also some instances of XML documents where data view can't be invoked at all. Although the XML would be considered well formed, if it isn't structured data, trying to switch to Data view generates the following message:
Although this document is well formed, it contains structure that Data View cannot display.
In Data view you can:
- Manually populate data tables
- Edit existing data tables
- Generate an XML Schema from an XML document
XML view
XML view provides an editor for editing raw XML and provides IntelliSense and color coding. Statement completion is available when working on .xsd
files and .xml
files that have an associated schema. Type < to initiate a tag and you're presented with a list of elements that are valid at that location. After you type the element name and press the SPACEBAR, you're presented with a list of attributes that the element supports.
Note
Microsoft IntelliSense options aren't available on the toolbar. When in the XML Editor, to access the options, on the Edit menu, select IntelliSense.
SHOWPLAN view
Query plans can be saved in XML format when created using SET SHOWPLAN_XML ON
option. Double-click a file with the .showplan
extension to open the query plan.