Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL server 2008 R2 Arithmetic overflow error converting numeric to data type numeric
    primarykey
    data
    text
    <p>I have a confusing error that I can not understand on SQL Server 2008 R2. </p> <p>But when I try the same request on a local server (SQL Server 2008 R2 also) everything works fine.</p> <p>So here is the request raising the problem:</p> <pre><code>select cast(cast(1.260 as numeric(13,3)) as numeric(10,2)) </code></pre> <p>I also added the result of some queries indicating the environment of each server:</p> <p><strong>On the local server:</strong></p> <pre><code>--------------------------------------- 1.26 (1 row(s) affected) Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64) Apr 22 2011 19:23:43 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 &lt;X64&gt; (Build 7601: Service Pack 1) ARITHABORT --------------------------------------------------------------------------------------------- 1 (1 row(s) affected) ARITHIGNORE --------------------------------------------------------------------------------------------- NULL (1 row(s) affected) ANSI_WARNINGS --------------------------------------------------------------------------------------------- 1 (1 row(s) affected) </code></pre> <p><strong>On the remote server:</strong></p> <blockquote> <p>Msg 8115, Level 16, State 7, Line 1<br> Arithmetic overflow error converting numeric to data type numeric.</p> </blockquote> <pre><code>Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) Jun 17 2011 00:54:03 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0 &lt;X64&gt; (Build 6002: Service Pack 2) (Hypervisor) (1 row(s) affected) ARITHABORT ------------------------------------------------------------------------------------------------------------ 1 (1 row(s) affected) ARITHIGNORE ------------------------------------------------------------------------------------------------------------ NULL (1 row(s) affected) ANSI_WARNINGS ------------------------------------------------------------------------------------------------------------ 1 (1 row(s) affected) </code></pre> <p>My question is how can I reproduce the problem that is occuring on the remote server. As you can see, the parameters ARITH... and ANSI_.. are the same on both servers. Is there any configuration on that kind of errors on the SQL Server?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload