Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataType Class

The DataType object represents a SQL Server data type.

System.Object
  Microsoft.SqlServer.Management.Smo.DataType

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
public class DataType : IXmlSerializable

The DataType type exposes the following members.

  NameDescription
Public methodDataType()Initializes a new instance of the DataType class.
Public methodDataType(SqlDataType)Initializes a new instance of the DataType class based on a specified SQL Server data type.
Public methodDataType(UserDefinedDataType)Initializes a new instance of the DataType class based on a specified user-defined data type.
Public methodDataType(UserDefinedTableType)Initializes a new instance of the DataType class based on a specified user-defined table type.
Public methodDataType(UserDefinedType)Initializes a new instance of the DataType class based on a specified user-defined type.
Public methodDataType(XmlSchemaCollection)Initializes a new instance of the DataType class based on a specified XML schema collection.
Public methodDataType(SqlDataType, Int32)Initializes a new instance of the DataType class based on a specified SQL Server data type with specified precision or maximum length.
Public methodDataType(SqlDataType, String)Initializes a new instance of the DataType class based on a specified SQL Server data type with the specified type.
Public methodDataType(SqlDataType, Int32, Int32)Initializes a new instance of the DataType class based on a specified SQL Server data type with the specified precision and scale.
Public methodDataType(SqlDataType, String, String)Initializes a new instance of the DataType class based on a specified SQL Server data type with the specified type and schema.
Top
  NameDescription
Public propertyStatic memberBigIntGets a data type that specifies the BigInt definition used in the data type.
Public propertyStatic memberBitGets a data type that specifies the Bit definition used in the data type.
Public propertyStatic memberDateThe Date property returns a Date data type.
Public propertyStatic memberDateTimeGets a data type that specifies the DateTime definition used in the data type.
Public propertyStatic memberFloatGets a data type that specifies the Float definition used in the data type.
Public propertyStatic memberGeographyThe geography data type represents data in a round-earth coordinate system. The SQL Server geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates.
Public propertyStatic memberGeometryThe Geometry property contains spatial data that represents information about the physical location and shape of geometric objects.
Public propertyStatic memberHierarchyIdThe HierarchyId property is used to identify a position in a hierarchy.
Public propertyStatic memberImageGets a data type that specifies the Image definition used in the data type.
Public propertyStatic memberIntGets a data type that specifies the Int definition used in the data type.
Public propertyMaximumLengthGets the maximum length of the data type.
Public propertyStatic memberMoneyGets a data type that specifies the Money definition used in the data type.
Public propertyNameGets the name of the data type.
Public propertyStatic memberNTextGets a data type that specifies the NText definition used in the data type.
Public propertyNumericPrecisionGets or sets the numeric precision of the data type.
Public propertyNumericScaleGets or sets the numeric scale of the data type.
Public propertyStatic memberNVarCharMaxGets a data type that specifies the VarCharMax definition used in the data type.
Public propertyStatic memberRealGets a data type that specifies the Money definition used in the data type.
Public propertySchemaGets or sets the schema of the data type.
Public propertyStatic memberSmallDateTimeGets a data type that specifies the SmallDateTime definition used in the data type.
Public propertyStatic memberSmallIntGets a data type that specifies the SmallInt definition used in the data type.
Public propertyStatic memberSmallMoneyGets a data type that specifies the SmallMoney definition used in the data type.
Public propertySqlDataTypeGets a data type that specifies the SqlDataType definition used in the data type.
Public propertyStatic memberSysNameGets a data type that specifies the SysName definition used in the data type.
Public propertyStatic memberTextGets a data type that specifies the Text definition used in the data type.
Public propertyStatic memberTimestampGets a data type that specifies the TimeStamp definition used in the data type.
Public propertyStatic memberTinyIntGets a data type that specifies the TinyInt definition used in the data type.
Public propertyStatic memberUniqueIdentifierGets a data type that specifies the UniqueIdentifier definition used in the data type.
Public propertyStatic memberVarBinaryMaxGets a data type that specifies the VarBinaryMax definition used in the data type.
Public propertyStatic memberVarCharMaxGets a data type that specifies the VarCharMax definition used in the data type.
Public propertyStatic memberVariantGets a data type that specifies the Variant definition used in the data type.
Public propertyXmlDocumentConstraintGets or sets a value that indicates how an XML document is formatted.
Top
  NameDescription
Public methodStatic memberBinaryReturns an object that represents the specified type.
Public methodStatic memberCharReturns an object that represents the specified type.
Public methodStatic memberDateTime2datetime2 is an extension of the existing datetime type. It has a large date range and large default fractional precision. It has a length of at least 19 positions.
Public methodStatic memberDateTimeOffsetReturns values for year, month, day, valid time of day between 00:00:00 and 23:59:59:9999999 and offset, in hours, from UTC. It has a length of at least 25 positions.
Public methodStatic memberDecimalReturns an object that represents the specified type.
Public methodEquals(Object)Determines whether the specified object is considered equal to the current data type. (Overrides Object.Equals(Object).)
Public methodEquals(DataType)Determines whether the specified data types are considered equal.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCodeThis method supports the SQL Server infrastructure and is not intended to be used directly from your code. (Overrides Object.GetHashCode().)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberNCharReturns an object that represents the specified type.
Public methodStatic memberNumericReturns an object that represents the specified type.
Public methodStatic memberNVarCharReturns an object that represents the specified type.
Public methodStatic memberTimeReturns values for any valid time of day between 00:00:00 and 23:59:59:9999999. It has a length of at least eight positions and contains the time in hours, minutes, seconds and fractional seconds.
Public methodToStringReturns the object in string format. (Overrides Object.ToString().)
Public methodStatic memberUserDefinedDataType(String)Returns an object that represents the specified type.
Public methodStatic memberUserDefinedDataType(String, String)Returns an object that represents the specified type with the specified schema.
Public methodStatic memberUserDefinedTableType(String)Returns an object that represents the specified type.
Public methodStatic memberUserDefinedTableType(String, String)Returns an object that represents the specified type with the specified schema.
Public methodStatic memberUserDefinedType(String)Returns an object that represents the specified type.
Public methodStatic memberUserDefinedType(String, String)Returns an object that represents the specified type with the specified schema.
Public methodStatic memberVarBinaryReturns an object that represents the specified type.
Public methodStatic memberVarCharReturns an object that represents the specified type.
Public methodStatic memberXml(String)Returns an object that represents the specified type.
Public methodStatic memberXml(String, String)Returns an object that represents the specified type and with the specified schema.
Public methodStatic memberXml(String, String, XmlDocumentConstraint)Returns an object that represents the specified type, schema and XML document constraint.
Top
  NameDescription
Explicit interface implemetationPrivate methodIXmlSerializable.GetSchemaNot implemented.
Explicit interface implemetationPrivate methodIXmlSerializable.ReadXmlDeserializes the DAC type properties from an XML stream. Identified for informational purposes only. Not supported. Future compatibility is not guaranteed..
Explicit interface implemetationPrivate methodIXmlSerializable.WriteXmlSerializes the data type properties to an XML stream. Identified for informational purposes only. Not supported. Future compatibility is not guaranteed..
Top

The DataType object is used to specify the type of data that is associated primarily with columns and parameters.

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.