<?xml version="1.0" encoding="utf-8"?>
<Type Name="SqlFacetAttribute" FullName="Microsoft.SqlServer.Server.SqlFacetAttribute">
  <TypeSignature Language="C#" Value="public class SqlFacetAttribute : Attribute" />
  <AssemblyInfo>
    <AssemblyName>System.Data</AssemblyName>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Attribute</BaseTypeName>
  </Base>
  <Interfaces />
  <Attributes>
    <Attribute>
      <AttributeName>System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue, AllowMultiple=false, Inherited=false)</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <since version=".NET 2.0" />
    <remarks>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>
        <see cref="T:Microsoft.SqlServer.Server.SqlFacetAttribute" /> may only be specified on non-void return values.</para>
      <para>
        <see cref="T:Microsoft.SqlServer.Server.SqlFacetAttribute" /> is used only to derive information about the return type, and is not intended to be a constraint specification on what can be stored in the type. Thus, if a field has a <see cref="T:Microsoft.SqlServer.Server.SqlFacetAttribute" /> indicating its size to be 2 characters, then the SQL Server type of the field access expression is of size 2, but assignments into the field are not restricted by this facet.</para>
      <para>The table below captures the matrix of valid values for the various properties for specific field types. In this table, "Y" indicates that the property is valid, and "N" indicates that the property is not valid. </para>
      <para>The specified <see cref="T:Microsoft.SqlServer.Server.SqlFacetAttribute" /> must be compatible with the field type. If the property is not valid, type registration will report an error if the user specifies a non-default value for the property. The maximum values for <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" /> and <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" /> properties are 38. For the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.MaxSize" /> property, the value should be in the range of 1-8000 for binary and non-Unicode data, 1-4000 for Unicode data, or -1. All other values are not valid.</para>
      <list type="table">
        <listheader>
          <item>
            <term>
              <para>Type</para>
            </term>
            <description>
              <para>IsFixedLength</para>
            </description>
            <description>
              <para>MaxSize</para>
            </description>
            <description>
              <para>Precision</para>
            </description>
            <description>
              <para>Scale</para>
            </description>
            <description>
              <para>IsNullable</para>
            </description>
          </item>
        </listheader>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlBoolean" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlByte" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlInt16" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlInt32" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlInt64" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlSingle" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlDouble" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlDateTime" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlMoney" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlGuid" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlDecimal" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlString" />
            </para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlBinary" />
            </para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlXml" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlBytes" />
            </para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Data.SqlTypes.SqlChars" />
            </para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>Embedded UDTs</para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.String" />
            </para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>Byte[]</para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>Char[]</para>
          </term>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.DateTime" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y<superscript>1</superscript></para>
          </description>
          <description>
            <para>N</para>
          </description>
        </item>
        <item>
          <term>
            <para>
              <see cref="T:System.Decimal" />
            </para>
          </term>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>N</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
          <description>
            <para>Y</para>
          </description>
        </item>
      </list>
      <para>(1) Specifying the scale on a DateTime type will cause the value to be returned to Transact-SQL as a DateTime2 type with the specified scale.</para>
    </remarks>
    <summary>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>Annotates the returned result of a user-defined type (UDT) with additional information that can be used in Transact-SQL.</para>
    </summary>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public SqlFacetAttribute ();" />
      <MemberType>Constructor</MemberType>
      <Parameters />
      <Docs>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>An optional attribute on a user-defined type (UDT) return type, used to annotate the returned result with additional information that can be used in Transact-SQL.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="IsFixedLength">
      <MemberSignature Language="C#" Value="public bool IsFixedLength { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Docs>
        <value>To be added.</value>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>This property must be set to false if the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.MaxSize" /> property is set to 1.</para>
          <para>The default value is false.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Indicates whether the return type of the user-defined type is of a fixed length.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="IsNullable">
      <MemberSignature Language="C#" Value="public bool IsNullable { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Docs>
        <value>To be added.</value>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The default value is true.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Indicates whether the return type of the user-defined type can be null.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="MaxSize">
      <MemberSignature Language="C#" Value="public int MaxSize { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <value>To be added.</value>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Logical unit is bytes (with a maximum size of 8000) for the binary and non-Unicode data types, and the number of Unicode characters (with a maximum size of 4000) for the character field types.</para>
          <para>The value -1 is reserved for large character and binary types. </para>
          <para>The default value is 4000 for Unicode character types and 8000 for binary and non-Unicode types.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The maximum size, in logical units, of the underlying field type of the user-defined type.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Precision">
      <MemberSignature Language="C#" Value="public int Precision { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <value>To be added.</value>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" /> property is valid only for numeric types. The <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" /> property must also be specified when setting the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" /> property. </para>
          <para>The maximum value of the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" /> property is 38; the default value is 38.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The precision of the return type of the user-defined type.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Scale">
      <MemberSignature Language="C#" Value="public int Scale { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <value>To be added.</value>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" /> property is valid only for decimal types. The <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" /> property must also be specified when setting the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" /> property. </para>
          <para>The maximum value of the <see cref="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" /> property is 38; the default value is 0.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The scale of the return type of the user-defined type.</para>
        </summary>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
  </Members>
</Type>