You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
43069.0122916667 value will not be written correctly to mssql #11959
For the value '43069.0122916667', it ended up written '6175.5241442476'
What is actually happening?
when 43069.0122916667 is passed to getSQLTypeFromJsType, the precision and scale will be set to 30 and 15.
Which in tedios isn't handled correctly.
see issue tediousjs/tedious#1058
@MartinJLee if you could do that it would be great! No need to go deep into it, just give me some direction... For instance, currently the precision is set to a constant (30). What it should depend on?
Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.
Reacted by Pol Thongtaem and Pedro Augusto de Paula Barbosa
Activity
papb commentedon Mar 17, 2020
Hello, thanks for filing the issue and writing a PR! It is not clear to me however if your PR #11962 fixed your problem entirely or just part of it.
Is the problem solved? Can this issue be closed? Thanks
JohnOnLee commentedon Mar 17, 2020
Hi @papb
for now, it will fix the issue. Ideally, we also want to set a correct precision value as per the comment in the code.
sequelize/lib/dialects/mssql/query.js
Line 36 in c845f0b
papb commentedon Mar 17, 2020
Nice! Do you have any idea on how to set the correct precision?
papb commentedon Mar 17, 2020
Closed by #11962
JohnOnLee commentedon Mar 18, 2020
I might need to have a look to figure that out.
papb commentedon Mar 18, 2020
@MartinJLee if you could do that it would be great! No need to go deep into it, just give me some direction... For instance, currently the precision is set to a constant (30). What it should depend on?
JohnOnLee commentedon Mar 18, 2020
@papb You can find the detail in the following link
https://docs.microsoft.com/en-us/sql/t-sql/data-types/precision-scale-and-length-transact-sql?view=sql-server-ver15