当选择&时,SQL自动将十进制转换为数字。插 [英] SQL auto converts decimal to numeric when select & insert
问题描述
当我做以下操作时:
$ b $
SELECT * INTO dbo.Local_table FROM dbo.Linked_table
所有十进制列自动转换为数字。
这是什么原因,怎样才能摆脱它?
是大多数SQL Server发生的自动转换。您至少会发现这种情况,但不限于服务器年度版本2000-2014。我不知道有一种方法来摆脱这个限制,因为它是一个内置的服务器功能,通过查询语句来限制算术方程。
这是另一个SO问题/答案可能会帮助你: 下面是一些MSDN的澄清: I have SQL Server 2008 R2 and linked SQL Server 2012.
When I do the following all decimal columns automatically get converted into numeric. What is the reason and how can I get rid of it? This is automatic conversion that occurs with most SQL Servers. You'll find this happening with at least, but not limited to, server year versions 2000-2014. I don't know of a way to get rid of this restriction because it's a built in server feature which restricts arithmetic equations via query statements. Here is another SO question/answer which might help you:
T-SQL Decimal Division Accuracy Here is some MSDN for clarification:
https://msdn.microsoft.com/en-us/library/ms187746.aspx 这篇关于当选择&时,SQL自动将十进制转换为数字。插的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
T-SQL十进制分割准确性 a>
https://msdn.microsoft.com/zh-cn/library/ms187746.aspx SELECT * INTO dbo.Local_table FROM dbo.Linked_table