From the course: Microsoft SQL Server 2016 Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Working with XML schemas

Working with XML schemas

- [Instructor] SQL server 2016 provides some tools for us to store XML in the database. One of those tools is we can define a structure of the XML. And we do that using what's called an XML schema. So just like a database schema defines the structure of a database, we have an XML schema that defines the structure of an XML document. So I've staged some code for you for this in your exercise files. I'll copy and paste all of that into a new query and I'd like this to be done in the demo database, I'll go with demo database two. I'll select that in the dropdown in management studio. And then we can look at our code. Keyword create, keyword XML, keyword schema, and keyword collection. Then I'm using the name testSchema1, then I'm providing an XML schema, some of this isn't the easiest to read but the high points are we're going to have a tag called FirstName with a minimum occurrence of one and the type will be string.…

Contents