XML IN THE DATABASE: THE XML DATA TYPE

XML IN THE DATABASE: THE XML DATA TYPE < ! other types omitted > Note that an XML schema collection has a SQL Server object name (dbo.peoplecoll, in this case) and consists of one or more schemas, defining the permitted types in one or more XML namespaces. It cannot be referenced outside the database it is defined in or by using a three-part object name, like pubs.dbo.peoplecoll. An XML schema that will be used to validate XML content also can have no associated namespace, like the first schema in the previous collection. This is known as the no-namespace schema and is distinguished by the fact that its schema element has no targetNamespace attribute. You are restricted to one nonamespace schema per XML schema collection. Typed XML XML data type columns, parameters, and variables may be typed or untyped; that is, they may conform to a schema or not. To specify that you are using a typed column, for example, in our XMLcolumn in the previous table, you would specify the schema collection name in parentheses, like this. CREATE TABLE xml_tab ( the_id INTEGER, xml_col XML(peoplecoll) ) By doing this, you ve just defined a series of integrity constraints with respect to what can appear in the XML that makes up that column! Typing the XML data in a column by using an XML schema collection not only serves as an integrity constraint, but is an optimization for SQL Server s

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

Bookmark the permalink.

Comments are closed.