Поделиться через


Класс UserDefinedDataType

The UserDefinedDataType object represents a SQL Server user-defined data type.

Иерархия наследования

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
          Microsoft.SqlServer.Management.Smo.ScriptSchemaObjectBase
            Microsoft.SqlServer.Management.Smo.UserDefinedDataType

Пространство имен:  Microsoft.SqlServer.Management.Smo
Сборка:  Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)

Синтаксис

'Декларация
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
<PhysicalFacetAttribute> _
Public NotInheritable Class UserDefinedDataType _
    Inherits ScriptSchemaObjectBase _
    Implements ICreatable, IAlterable, IDroppable, IRenamable,  _
    IExtendedProperties, IScriptable, ISfcSupportsDesignMode, IObjectPermission
'Применение
Dim instance As UserDefinedDataType
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[PhysicalFacetAttribute]
public sealed class UserDefinedDataType : ScriptSchemaObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, 
    IScriptable, ISfcSupportsDesignMode, IObjectPermission
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
[PhysicalFacetAttribute]
public ref class UserDefinedDataType sealed : public ScriptSchemaObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, 
    IScriptable, ISfcSupportsDesignMode, IObjectPermission
[<SealedAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
[<PhysicalFacetAttribute>]
type UserDefinedDataType =  
    class 
        inherit ScriptSchemaObjectBase 
        interface ICreatable 
        interface IAlterable 
        interface IDroppable 
        interface IRenamable 
        interface IExtendedProperties 
        interface IScriptable 
        interface ISfcSupportsDesignMode 
        interface IObjectPermission 
    end
public final class UserDefinedDataType extends ScriptSchemaObjectBase implements ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, IScriptable, ISfcSupportsDesignMode, IObjectPermission

Тип UserDefinedDataType обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод UserDefinedDataType() Initializes a new instance of the UserDefinedDataType class.
Открытый метод UserDefinedDataType(Database, String) Initializes a new instance of the UserDefinedDataType class on the specified database and with the specified name.
Открытый метод UserDefinedDataType(Database, String, String) Initializes a new instance of the UserDefinedDataType class on the specified database and with the specified name and schema.

В начало

Свойства

  Имя Описание
Открытое свойство AllowIdentity Gets the Boolean property value that specifies whether the user-defined data type is able to participate in a column defined with the identity property.
Открытое свойство Collation Gets the collation assigned to the user-defined data type.
Открытое свойство Default Gets or sets a SQL Server default that is bound to the user-defined data type.
Открытое свойство DefaultSchema Gets or sets the SQL Server default schema for the user-defined data type.
Открытое свойство ExtendedProperties Gets the extended properties of the user-defined data type.
Открытое свойство ID Gets an ID value that uniquely identifies the user-defined data type.
Открытое свойство IsSchemaOwned Gets a Boolean value that indicates whether the UserDefinedDataType object is owned by a schema.
Открытое свойство Length Gets or sets the number of characters in the user-defined data type.
Открытое свойство MaxLength Gets the maximum number of characters accepted by the user-defined data type.
Открытое свойство Name Gets or sets a String value that specifies the name of the user defined data type. (Переопределяет ScriptSchemaObjectBase.Name.)
Открытое свойство Nullable Gets or sets the Boolean property value that specifies whether the user-defined data type accepts null values or not.
Открытое свойство NumericPrecision Gets or sets the maximum number of digits in a numeric value used in the definition of the user-defined data type.
Открытое свойство NumericScale Gets or sets the maximum number of digits to the right of the decimal point in a numeric value used in the definition of the user-defined data type.
Открытое свойство Owner Gets the name of the owner of the UserDefinedDataType object.
Открытое свойство Parent Gets or sets the Database object that is the parent of the UserDefinedDataType object.
Открытое свойство Properties Gets a collection of Property objects that represent the object properties. (Производный от SqlSmoObject.)
Открытое свойство Rule Gets or sets a SQL Server rule that is bound to the user-defined data type.
Открытое свойство RuleSchema Gets or sets the SQL Server rule schema for the user-defined data type.
Открытое свойство Schema Gets or sets a String value that specifies the name of the schema that contains the user defined data type. (Переопределяет ScriptSchemaObjectBase.Schema.)
Открытое свойство State Gets the state of the referenced object. (Производный от SmoObjectBase.)
Открытое свойство SystemType Gets or sets the base system data type from which the user-defined data type is derived.
Открытое свойство Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Производный от SqlSmoObject.)
Открытое свойство UserData Gets or sets user-defined data associated with the referenced object. (Производный от SmoObjectBase.)
Открытое свойство VariableLength Gets the Boolean property value that specifies whether the user-defined data type is variable in length.

В начало

Методы

  Имя Описание
Открытый метод Alter Updates any UserDefinedDataType object property changes on the instance of Microsoft SQL Server. 
Открытый метод BindDefault(String, String) Binds a default to the user-defined data type.
Открытый метод BindDefault(String, String, Boolean) Binds a default to the user-defined data type.
Открытый метод BindRule(String, String) Binds a default to the user-defined data type.
Открытый метод BindRule(String, String, Boolean) Binds a default to the user-defined data type.
Открытый метод Create Creates a user-defined data type on the instance of Microsoft SQL Server as defined by the UserDefinedType object.
Открытый метод Deny(ObjectPermissionSet, String) Denies the specified set of permissions for the specified grantee on the user-defined data type.
Открытый метод Deny(ObjectPermissionSet, array<String[]) Denies the specified set of permissions for the specified grantees on the user-defined data type.
Открытый метод Deny(ObjectPermissionSet, String, Boolean) Denies the specified set of permissions for the specified grantee and other users that the grantee granted the specified set of permissions on the user-defined data type.
Открытый метод Deny(ObjectPermissionSet, array<String[], Boolean) Denies the specified set of permissions for the specified grantees and other users that the grantee granted the specified set of permissions on the user-defined data type.
Открытый метод Discover Discovers a list of type Object. (Производный от SqlSmoObject.)
Открытый метод Drop Removes the user-defined data type from the instance of Microsoft SQL Server.
Открытый метод EnumBoundColumns Enumerates a list of columns to which the user-defined data type type is bound.
Открытый метод EnumObjectPermissions() Enumerates a list of object permissions for the user-defined data type.
Открытый метод EnumObjectPermissions(String) Enumerates a list of object permissions for a specified grantee on the user-defined data type.
Открытый метод EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of object permissions for a specified permission on the user-defined data type.
Открытый метод EnumObjectPermissions(String, ObjectPermissionSet) Enumerates a list of object permissions for a specified grantee and a specified permission on the user-defined data type.
Открытый метод Equals (Производный от Object.)
Защищенный метод FormatSqlVariant Formats an object as SqlVariant type. (Производный от SqlSmoObject.)
Защищенный метод GetContextDB Gets the context database that is associated with this object. (Производный от SqlSmoObject.)
Защищенный метод GetDBName Gets the database name that is associated with the object. (Производный от SqlSmoObject.)
Открытый метод GetHashCode (Производный от Object.)
Защищенный метод GetPropValue Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptional Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetServerObject Gets the server of the SqlSmoObject object. (Производный от SqlSmoObject.)
Открытый метод GetType (Производный от Object.)
Открытый метод Grant(ObjectPermissionSet, String) Grants the specified set of permissions to the specified grantee on the user-defined data type.
Открытый метод Grant(ObjectPermissionSet, array<String[]) Grants the specified set of permissions to the specified grantees on the user-defined data type.
Открытый метод Grant(ObjectPermissionSet, String, Boolean) Grants the specified set of permissions to the grantee and the ability to grant the specified set of permissions to other users on the user-defined data type.
Открытый метод Grant(ObjectPermissionSet, array<String[], Boolean) Grants the specified set pf permissions to the grantees and the ability to grant the specified set of permissions to other users on the user-defined data type.
Открытый метод Grant(ObjectPermissionSet, String, Boolean, String) Grants the specified set of permissions to the grantee and the ability to grant the set of permissions to other users on the user-defined data type under an assumed role.
Открытый метод Grant(ObjectPermissionSet, array<String[], Boolean, String) Grants the specified set of permissions to the grantees and the ability to grant the set of permissions to other users on the user-defined data type data type under an assumed role.
Открытый метод Initialize() Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Открытый метод Initialize(Boolean) Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInitialized Verifies whether the object has been initialized. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Производный от SqlSmoObject.)
Открытый метод Refresh Refreshes the script name. (Производный от ScriptNameObjectBase.)
Открытый метод Rename Renames the user defined data type.
Открытый метод Revoke(ObjectPermissionSet, String) Revokes a previously granted set of permissions from a grantee on the user-defined data type.
Открытый метод Revoke(ObjectPermissionSet, array<String[]) Revokes a previously granted set of permissions from a list of grantees on the user-defined data type.
Открытый метод Revoke(ObjectPermissionSet, String, Boolean, Boolean) Revokes previously granted permissions from a grantee on the user-defined data type and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
Открытый метод Revoke(ObjectPermissionSet, array<String[], Boolean, Boolean) Revokes previously granted permissions from grantees on the user-defined data type and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
Открытый метод Revoke(ObjectPermissionSet, String, Boolean, Boolean, String) Revokes previously granted permissions from a grantee on the user-defined data type and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
Открытый метод Revoke(ObjectPermissionSet, array<String[], Boolean, Boolean, String) Revokes previously granted permissions from grantees on the user-defined data type and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
Открытый метод Script() Generates a Transact-SQL script that can be used to re-create the user-defined data type.
Открытый метод Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the user-defined data type as specified by the script options.
Защищенный метод SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Производный от SqlSmoObject.)
Открытый метод ToString Returns a String that represents the referenced object. (Производный от SqlSmoObject.)
Открытый метод UnbindDefault() Unbinds a default from the user-defined data type.
Открытый метод UnbindDefault(Boolean) Unbinds a default from the user-defined data type.
Открытый метод UnbindRule() Unbinds a rule from the user-defined data type.
Открытый метод UnbindRule(Boolean) Unbinds a rule from the user-defined data type.
Открытый метод Validate Validates the state of an object. (Производный от SmoObjectBase.)

В начало

События

  Имя Описание
Открытое событие PropertyChanged Represents the event that occurs when a property is changed. (Производный от SqlSmoObject.)
Открытое событие PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Производный от SqlSmoObject.)

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод IAlienObject.Discover Discovers any dependencies. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetDomainRoot Returns the root of the domain. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetParent Gets the parent of this object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyType Gets the type of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyValue Gets the value of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetPropertyValue Sets the property value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытое свойство ISfcSupportsDesignMode.IsDesignMode Gets a Boolean value that specifies whether the user defined data type supports design mode.

В начало

Замечания

To get UserDefinedDataType object permissions, users can be a member of the public fixed server role.

To set UserDefinedDataType object permissions, users must have CREATE TYPE permission in the parent database and ALTER permission on specified schema. If an assembly is specified, users must either own the assembly or have REFERENCES permission on it.

To create an user-defined data type data type, users must have CREATE TYPE permission in the parent database and ALTER permission on specified schema. If an assembly is specified, users must either own the assembly or have REFERENCES permission on it.

To drop a user-defined data type data type, users must have CONTROL permission on the type and ALTER permission on the specified schema.

Thread Safety

Все общие статические члены этого типа (Shared в Microsoft Visual Basic) можно использовать в многопоточных операциях. Потокобезопасная работа с членами экземпляров типа не гарантируется.

Примеры

Работа с типами данных

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.Smo

Другие ресурсы

Типы данных (компонент Database Engine)