SqlUserDefinedTypeAttribute 클래스

정의

SQL Server에서 어셈블리의 형식 정의를 UDT(사용자 정의 형식)로 표시하는 데 사용됩니다. 특성의 속성은 SQL Server에 형식을 등록할 때 사용되는 실제 특성을 반영합니다. 이 클래스는 상속될 수 없습니다.

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
상속
SqlUserDefinedTypeAttribute
특성

예제

다음 예제에서는 Point UDT의 특성을 보여줍니다 UserDefinedType . UDT는 바이트 순서로 지정되고 이름이 "Point"이고 유효성 검사 메서드가 "ValidatePoint"이며 네이티브 serialization 형식을 사용합니다.

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 사용자 지정 특성이 있는 형식 정의에 바인딩된 사용자 정의 형식을 SqlUserDefinedTypeAttribute 만듭니다. 모든 UDT는 이 특성으로 주석을 추가해야 합니다. UDT 예제를 포함하여 UDT에 대한 자세한 내용은 CLR User-Defined 형식 을 참조하세요.

생성자

SqlUserDefinedTypeAttribute(Format)

UDT(사용자 정의 형식)의 필수 특성으로, 지정된 형식이 UDT인지 확인하고 UDT의 스토리지 형식을 나타내는 데 사용됩니다.

속성

Format

의 serialization 형식입니다 Format .

IsByteOrdered

사용자 정의 형식이 바이트를 기준으로 정렬되는지 여부를 나타냅니다.

IsFixedLength

이 사용자 정의 형식의 모든 인스턴스 길이가 같은지 여부를 나타냅니다.

MaxByteSize

인스턴스의 최대 크기(바이트)입니다.

Name

사용자 정의 형식의 SQL Server 이름입니다.

ValidationMethodName

사용자 정의 형식의 인스턴스가 유효한지 검사하는 데 사용되는 메서드의 이름입니다.

적용 대상