System.Data 2.0.0.0 System.Attribute System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=true)

SQL Server creates a user-defined type that is bound to the type definition that has the custom attribute. Every UDT must be annotated with this attribute. See CLR User-Defined Types for more information about UDTs, including an example of a UDT.

Used to mark a type definition in an assembly as a user-defined type (UDT) in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. This class cannot be inherited.

- Constructor
  To be added.

  The following example specifies that the Format of the user-defined type is SerializedDataWithMetadata and the MaxByteSize is 8000 bytes.

  A required attribute on a user-defined type (UDT), used to confirm that the given type is a UDT and to indicate the storage format of the UDT.

  2.0.0.0
- Property
  Microsoft.SqlServer.Server.Format To be added. To be added.

  The serialization format as a .

  2.0.0.0
- Property
  System.Boolean To be added.

  When set to true, the property in effect guarantees that the serialized binary data can be used for semantic ordering of the information. Thus, each instance of a byte-ordered UDT object can only have one serialized representation. When a comparison operation is performed in SQL Server on the serialized bytes, its results should be the same as if the same comparison operation had taken place in managed code..

  The following features are supported when is set to true:

  The ability to create indexes on columns of this type.

  The ability to create primary and foreign keys as well as CHECK and UNIQUE constraints on columns of this type.

  The ability to use Transact-SQL ORDER BY, GROUP BY, and PARTITION BY clauses. In these cases, the binary representation of the type is used to determine the order.

  The ability to use comparison operators in Transact-SQL statements.

  The ability to persist computed columns of this type.

  Note that both the Native and UserDefined serialization formats support the following comparison operators when is set to true:

  Equal to (=)

  Not equal to (!=)

  Greater than (>)

  Less than (<)

  Greater than or equal to (>=)

  Less than or equal to (<=)

  Indicates whether the user-defined type is byte ordered.

  2.0.0.0
- Property
  System.Boolean To be added.

  If set to true, all instances of UDTs corresponding to this common language runtime (CLR) type must have a length in bytes exactly equal to . This attribute is only relevant for UDTs with UserDefined serialization .

  Indicates whether all instances of this user-defined type are the same length.

  2.0.0.0
- Property
  System.Int32 To be added.

  You must specify the property with the UserDefined serialization .

  When connecting to SQL Server 2005 or earlier, must be between 1 and 8000.

  When connecting to SQL Server 2008 or later, set between 1 and 8000, for a type whose instances are always 8,000 bytes or less. For types that can have instances larger than 8000, specify -1.

  For a UDT with user-defined serialization specified, refers to the total size of the UDT in its serialized form as defined by the user. Consider a UDT with a property of a string of 10 characters (). When the UDT is serialized using a , the total size of the serialized string is 22 bytes: 2 bytes per Unicode UTF-16 character, multiplied by the maximum number of characters, plus 2 control bytes of overhead incurred from serializing a binary stream. So, when determining the value of , the total size of the serialized UDT must be considered: the size of the data serialized in binary form plus the overhead incurred by serialization.

  This property should not be used with Native serialization .

  The maximum size of the instance, in bytes.

  2.0.0.0