Export (0) Print
Expand All

DataType.Xml Method (String, String, XmlDocumentConstraint)

Returns an object that represents the specified type, schema and XML document constraint.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public static DataType Xml(
	string type,
	string schema,
	XmlDocumentConstraint xmlDocumentConstraint
)

Parameters

type
Type: String
A String value that specifies the type.
schema
Type: String
A String value that specifies the schema of the type.
xmlDocumentConstraint
Type: Microsoft.SqlServer.Management.Smo.XmlDocumentConstraint
A XmlDocumentConstraint value that determines the XML document constraint.

Return Value

Type: Microsoft.SqlServer.Management.Smo.DataType
A DataType object value.

The XmlDocumentConstraint object supports the following values:

Default - Unstructured data

Content - XML fragment

Document - A well formed XML instance

Visual Basic

Dim dt As DataType
dt = New DataType(SqlDataType.Xml, "Test XML Schema", "<xsd:schema xmlns:xsd=\`"http://www.w3.org/2001/XMLSchema\`" targetNamespace=\`"NS2\`"><xsd:element name=\`"elem1\`" type=\`"xsd:integer\`"/></xsd:schema>", XmlDocumentConstraint.Content
)

PowerShell

$dt = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::Xml, "Test XML Schema", "<xsd:schema xmlns:xsd=\`"http://www.w3.org/2001/XMLSchema\`" targetNamespace=\`"NS2\`"><xsd:element name=\`"elem1\`" type=\`"xsd:integer\`"/></xsd:schema>", [Microsoft.SqlServer.Management.Smo.XmlDocumentConstraint]::Content)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft