forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSqlFacetAttribute.xml
223 lines (201 loc) · 11.2 KB
/
SqlFacetAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<Type Name="SqlFacetAttribute" FullName="Microsoft.SqlServer.Server.SqlFacetAttribute">
<TypeSignature Language="C#" Value="public class SqlFacetAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SqlFacetAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:Microsoft.SqlServer.Server.SqlFacetAttribute" />
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.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>
<summary>Annotates the returned result of a user-defined type (UDT) with additional information that can be used in Transact-SQL.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:Microsoft.SqlServer.Server.SqlFacetAttribute> may only be specified on non-void return values.
<xref: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 <xref: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.
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.
The specified <xref: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 <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision%2A> and <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale%2A> properties are 38. For the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.MaxSize%2A> 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.
|Type|IsFixedLength|MaxSize|Precision|Scale|IsNullable|
|----------|-------------------|-------------|---------------|-----------|----------------|
|<xref:System.Data.SqlTypes.SqlBoolean>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlByte>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlInt16>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlInt32>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlInt64>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlSingle>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlDouble>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlDateTime>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlMoney>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlGuid>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlDecimal>|N|N|Y|Y|Y|
|<xref:System.Data.SqlTypes.SqlString>|Y|Y|N|N|Y|
|<xref:System.Data.SqlTypes.SqlBinary>|Y|Y|N|N|Y|
|<xref:System.Data.SqlTypes.SqlXml>|N|N|N|N|Y|
|<xref:System.Data.SqlTypes.SqlBytes>|Y|Y|N|N|Y|
|<xref:System.Data.SqlTypes.SqlChars>|Y|Y|N|N|Y|
|Embedded UDTs|N|N|N|N|Y|
|<xref:System.String>|Y|Y|N|N|Y|
|Byte[]|Y|Y|N|N|Y|
|Char[]|Y|Y|N|N|Y|
|<xref:System.DateTime>|N|N|N|Y<sup>1</sup>|N|
|<xref:System.Decimal>|N|N|Y|Y|Y|
(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.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlFacetAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.SqlServer.Server.SqlFacetAttribute.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>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.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsFixedLength">
<MemberSignature Language="C#" Value="public bool IsFixedLength { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsFixedLength" />
<MemberSignature Language="DocId" Value="P:Microsoft.SqlServer.Server.SqlFacetAttribute.IsFixedLength" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Indicates whether the return type of the user-defined type is of a fixed length.</summary>
<value>
<see langword="true" /> if the return type is of a fixed length; otherwise <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property must be set to `false` if the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.MaxSize%2A> property is set to 1.
The default value is `false`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsNullable">
<MemberSignature Language="C#" Value="public bool IsNullable { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsNullable" />
<MemberSignature Language="DocId" Value="P:Microsoft.SqlServer.Server.SqlFacetAttribute.IsNullable" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Indicates whether the return type of the user-defined type can be <see langword="null" />.</summary>
<value>
<see langword="true" /> if the return type of the user-defined type can be <see langword="null" />; otherwise <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The default value is `true`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="MaxSize">
<MemberSignature Language="C#" Value="public int MaxSize { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 MaxSize" />
<MemberSignature Language="DocId" Value="P:Microsoft.SqlServer.Server.SqlFacetAttribute.MaxSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>The maximum size, in logical units, of the underlying field type of the user-defined type.</summary>
<value>An <see cref="T:System.Int32" /> representing the maximum size, in logical units, of the underlying field type.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
The value -1 is reserved for large character and binary types.
The default value is 4000 for Unicode character types and 8000 for binary and non-Unicode types.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Precision">
<MemberSignature Language="C#" Value="public int Precision { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Precision" />
<MemberSignature Language="DocId" Value="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>The precision of the return type of the user-defined type.</summary>
<value>An <see cref="T:System.Int32" /> representing the precision of the return type.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision%2A> property is valid only for numeric types. The <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale%2A> property must also be specified when setting the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision%2A> property.
The maximum value of the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision%2A> property is 38; the default value is 38.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Scale">
<MemberSignature Language="C#" Value="public int Scale { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Scale" />
<MemberSignature Language="DocId" Value="P:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>The scale of the return type of the user-defined type.</summary>
<value>An <see cref="T:System.Int32" /> representing the scale of the return type.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale%2A> property is valid only for decimal types. The <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Precision%2A> property must also be specified when setting the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale%2A> property.
The maximum value of the <xref:Microsoft.SqlServer.Server.SqlFacetAttribute.Scale%2A> property is 38; the default value is 0.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>