Repository navigation
Description
Describe the bug
My unit tests fail after updating to the latest version. This is the stack trace:
System.ArgumentException
Parameter value '0.000' is out of range.
at Microsoft.Data.SqlClient.TdsParser.TDSExecuteRPCAddParameter(TdsParserStateObject stateObj, SqlParameter param, MetaType mt, Byte options, SqlCommand command, Boolean isAnonymous)
at Microsoft.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, IList`1 rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean isRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& executeTask, Boolean& usedCache, Boolean asyncWrite, Boolean isRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
I'm writing 0 to a column that is decimal(3,3). TdsParser.AdjustDecimalScale changes the precision from 3 to 4 and then I get the exception. If I change the value of the property of the entity from C# default of 0M to 0.001M it works. I assume this is related to #4443.
To reproduce
I have created a repo that demonstrates the issue: https://github.com/andygjp/TdsParserArgumentException.
Expected behavior
Should be able to use default values for decimal types.
Further technical details
Microsoft.EntityFrameworkCore.SqlServer: 11.0.0-rc.1.26425.128
Microsoft.Data.SqlClient: 7.1.0
.NET: 11.0.100-rc.1.26425.128
SQL Server 2025 (https://mcr.microsoft.com/en-us/artifact/mar/mssql/server/tag/2025-latest)
MacOS 27
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Sep 21, 2026
andygjp commentedon Sep 21, 2026
I have created a repo that demonstrates the issue: https://github.com/andygjp/TdsParserArgumentException
github-actions commentedon Sep 21, 2026
andygjp commentedon Sep 21, 2026
In case the bot has trouble reading the first message...
Further technical details
Microsoft.EntityFrameworkCore.SqlServer: 11.0.0-rc.1.26425.128
Microsoft.Data.SqlClient: 7.1.0
.NET: 11.0.100-rc.1.26425.128
SQL Server 2025 image: https://mcr.microsoft.com/en-us/artifact/mar/mssql/server/tag/2025-latest
OS: MacOS 27
10 remaining items
paulmedynski commentedon Sep 22, 2026
Re-opening until the 7.1 PR is closed.
cheenamalhotra commentedon Sep 30, 2026
Issue fixed.
Bump the nuget-minor-and-patch group with 4 updates (#74)
Bump the microsoft group with 11 updates (#1370)
Bump the nuget-ecosystem group with 6 updates (#16)
Bump the nuget-ecosystem group with 9 updates (#76)