Decimal value with 5 decimal places in sql server

1

I am developing a (Asp.NET MVC 5.2.3.0, EF 6.1.3 e SQL Server 2012) application, the database has a table with the decimal(6, 5) field, when saving a value in this -2,56478 field, for example in the database it is -2,56000 . A% with%.

Is it SQL Server or EF configuration? Has anyone gone through this and can you help me?

    
asked by anonymous 22.02.2016 / 21:04

1 answer

0

Just to register, the problem I mentioned above was because the ORM generation was generated via Reverse Engineering (EF PowerTools), unfortunately I do not know if it was the version of the tool I'm currently using, but I have not tested it yet. Plus the problem was solved by reverse engineering with CodeFirst (Code First from database) from Update 2 of Visual Studio 2013 and EntityFramework 6.1.

Below the profiler result:

exec sp_executesql N'UPDATE [dbo].[TABELA]
SET [CAMPO01] = @0, [CAMPO02] = @1, [CAMPO03] = @2, [CAMPO04] = @3, **[Latitude] = @4**, [Longitude] = @5, [CAMPO05] = @6, [CAMPO06] = @7
WHERE ([ID] = @8)
',N'@0 int,@1 int,@2 datetime2(7),@3 int,**@4 decimal(6,5)**,@5 decimal(7,5),@6 tinyint,@7 varchar(max) ,@8 int',@0=1001,@1=1029,@2='2016-02-17 00:00:00',@3=208,@4=-1.25789,@5=-65.25698,@6=2,@7='Olá, Mundo...',@8=2763, agora a precision e scale são reconhecida pois no Context criado foi acrescido .HasPrecision(6, 5).
    
23.02.2016 / 14:30