通过调用store proc,十进制值无法在数据库中的数据表中正确插入 [英] Decimal values are not inserting properly in datatable in database by calling the store proc

查看:99
本文介绍了通过调用store proc,十进制值无法在数据库中的数据表中正确插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试执行store-procedure时,它会在数据库中正确插入值。尝试从前端(MVC,entityFramework(db First)方法)它返回值,第一个和第二个表记录正确插入数据库中的准确值。

值插入目的我在db上使用temptable侧。计算所有事情只在后端完成。



我尝试过:



如果我使用< pre> SET FMTONLY OFF 

只在数据库中插入单个记录。

单个记录值(十进制值)正在插入正确。



当在商店proc中删除SET FMTONLY OFF时它会插入所有记录。但十进制字段值是在数据表中插入0值。

你能不能请任何人帮助我这个pblm。

解决方案

我不知道我不知道你正在使用什么版本,但这个链接可能有所帮助:



https://docs.microsoft.com/en-us / SQL / T-SQL /语句/设定FMTONLY-的Transact-SQL

When I am trying too execute store-procedure it inserting values correctly in database. Trying from front end (MVC,entityFramework(db First ) approach) it sending the values back and first and second table records are inserting correctly with accurate values in database.
values inserting purpose am using temptable on db side. calculation all things done in backend only.

What I have tried:

if I am using <pre>SET FMTONLY OFF

inserting only single record in database.
single records values (decimal Values) are inserting correctly.

when am removing the SET FMTONLY OFF in store proc it is inserting all records. but decimal filed values are inserting 0 values in data table.
can you please any one help me on this pblm.

解决方案

I don't know what version you are using but this link might help:

https://docs.microsoft.com/en-us/sql/t-sql/statements/set-fmtonly-transact-sql


这篇关于通过调用store proc,十进制值无法在数据库中的数据表中正确插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆