Mchief
Mchief

Reputation: 137

SQL auto converts decimal to numeric when select & insert

I have SQL Server 2008 R2 and linked SQL Server 2012. When I do the following

SELECT * INTO dbo.Local_table FROM dbo.Linked_table

all decimal columns automatically get converted into numeric.

What is the reason and how can I get rid of it?

Upvotes: 1

Views: 176

Answers (1)

Royce104
Royce104

Reputation: 21

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

Upvotes: 1

Related Questions