File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,12 @@ let ``Roundtrip ToTraceString for unicode``() =
140140
141141[<Fact>]
142142let ``Roundtrip ToTraceString for decimals with maximum precision`` () =
143- let cmd = new SqlCommandProvider< " SELECT CAST(@x AS DECIMAL(38, 18))" , ConnectionStrings.AdventureWorksNamed>()
144- let decimal_38_18 = 12345678901234567890.123456789012345678 m
145- let result = runScalarQuery <| cmd.ToTraceString( decimal_ 38_ 18)
146- Assert.Equal( expected = decimal_ 38_ 18, actual = unbox< decimal> result)
143+ // Note: maximum precision for MSSQL decimals is 38, but maximum for MSSQL <-> .NET conversion is 29
144+ // https://weblogs.sqlteam.com/mladenp/2010/08/31/when-does-sql-server-decimal-not-convert-to-net-decimal/
145+ let cmd = new SqlCommandProvider< " SELECT CAST(@x AS DECIMAL(29, 19))" , ConnectionStrings.AdventureWorksNamed>()
146+ let decimal_29_19 = 1234567890.1234567890123456789 m
147+ let result = runScalarQuery <| cmd.ToTraceString( decimal_ 29_ 19)
148+ Assert.Equal( expected = decimal_ 29_ 19, actual = unbox< decimal> result)
147149
148150[<Fact>]
149151let ``Roundtrip ToTraceString for date time `` () =
You can’t perform that action at this time.
0 commit comments