Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions xml/System.Data.SqlClient/SqlParameter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1229,11 +1229,13 @@ static void CreateSqlParameterLocaleId(){
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Data.SqlClient.SqlParameter.Scale%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
The <xref:System.Data.SqlClient.SqlParameter.Scale%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`, `DateTime2`, `DateTimeOffset` or `Time`.

> [!WARNING]
> Data may be truncated if the <xref:System.Data.SqlClient.SqlParameter.Scale%2A> property is not explicitly specified and the data on the server does not fit in scale 0 (the default).

> For the `DateTime2` type, scale 0 (the default) will be passed as datetime2(7). There is currently no way to send a parameter as datetime2(0). Scales 1-7 work as expected.
This problem applies to `DateTimeOffset` and `Time` as well.

You do not need to specify values for the <xref:System.Data.SqlClient.SqlParameter.Precision%2A> and <xref:System.Data.SqlClient.SqlParameter.Scale%2A> properties for input parameters, as they can be inferred from the parameter value. `Precision` and `Scale` are required for output parameters and for scenarios where you need to specify complete metadata for a parameter without indicating a value, such as specifying a null value with a specific precision and scale.

> [!NOTE]
Expand Down Expand Up @@ -2068,4 +2070,4 @@ FieldName = @OriginalFieldName
</Docs>
</Member>
</Members>
</Type>
</Type>