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.
public ref class SqlUserDefinedTypeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=true)]
public sealed class SqlUserDefinedTypeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=true)>]
type SqlUserDefinedTypeAttribute = class
inherit Attribute
Public NotInheritable Class SqlUserDefinedTypeAttribute
Inherits Attribute
The following example shows the UserDefinedType
attribute of the Point UDT. The UDT is byte-ordered, is named "Point", has a validation method named "ValidatePoint", and uses the native serialization format.
using Microsoft.Data.SqlClient.Server;
using System.Data.SqlTypes;
using System.Text;
[Serializable]
[Microsoft.Data.SqlClient.Server.SqlUserDefinedType(Format.Native,
IsByteOrdered = true,
Name = "Point", ValidationMethodName = "ValidatePoint")]
public struct Point : INullable
{
SQL Server creates a user-defined type that is bound to the type definition that has the SqlUserDefinedTypeAttribute 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.
Constructors SqlUserDefinedTypeAttribute(Format)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.
Properties FormatThe serialization format as a Format .
IsByteOrderedIndicates whether the user-defined type is byte ordered.
IsFixedLengthIndicates whether all instances of this user-defined type are the same length.
MaxByteSizeThe maximum size of the instance, in bytes.
NameThe SQL Server name of the user-defined type.
ValidationMethodNameThe name of the method used to validate instances of the user-defined type.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4