DataType.Xml DataType.Xml DataType.Xml Method

Definition

Returns an object that represents the specified type.

Overloads

Xml(String, String) Xml(String, String) Xml(String, String)

Returns an object that represents the specified type and with the specified schema.

Xml(String, String, XmlDocumentConstraint) Xml(String, String, XmlDocumentConstraint)

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

Xml(String) Xml(String) Xml(String)

Returns an object that represents the specified type.

Xml(String, String) Xml(String, String) Xml(String, String)

Returns an object that represents the specified type and with the specified schema.

public:
 static Microsoft::SqlServer::Management::Smo::DataType ^ Xml(System::String ^ type, System::String ^ schema);
public static Microsoft.SqlServer.Management.Smo.DataType Xml (string type, string schema);
Public Shared Function Xml (type As String, schema As String) As DataType
Parameters
type
String String String

A String value that specifies the type.

schema
String String String

A String value that specifies the schema of the type.

Returns

Examples

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>")  

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>")  

Xml(String, String, XmlDocumentConstraint) Xml(String, String, XmlDocumentConstraint)

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

public:
 static Microsoft::SqlServer::Management::Smo::DataType ^ Xml(System::String ^ type, System::String ^ schema, Microsoft::SqlServer::Management::Smo::XmlDocumentConstraint xmlDocumentConstraint);
public static Microsoft.SqlServer.Management.Smo.DataType Xml (string type, string schema, Microsoft.SqlServer.Management.Smo.XmlDocumentConstraint xmlDocumentConstraint);
Parameters
type
String String String

A String value that specifies the type.

schema
String String String

A String value that specifies the schema of the type.

xmlDocumentConstraint
XmlDocumentConstraint XmlDocumentConstraint XmlDocumentConstraint

A XmlDocumentConstraint value that determines the XML document constraint.

Returns

Examples

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)  

Remarks

The XmlDocumentConstraint object supports the following values:

Default - Unstructured data

Content - XML fragment

Document - A well formed XML instance

Xml(String) Xml(String) Xml(String)

Returns an object that represents the specified type.

public:
 static Microsoft::SqlServer::Management::Smo::DataType ^ Xml(System::String ^ type);
public static Microsoft.SqlServer.Management.Smo.DataType Xml (string type);
Public Shared Function Xml (type As String) As DataType
Parameters
type
String String String

A String value that specifies the type.

Returns

Examples

Visual Basic

Dim dt As DataType  
dt = New DataType(SqlDataType.Xml, "Test XML Schema")  

PowerShell

$dt = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::Xml, "Test XML Schema")  

Applies to