<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; FIX : Error : msg 8115, Level 16, State 2, Line 2 &#8211; Arithmetic overflow error converting expression to data type</title>
	<atom:link href="http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:36:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: chandar</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-204838</link>
		<dc:creator><![CDATA[chandar]]></dc:creator>
		<pubDate>Sat, 26 Nov 2011 08:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-204838</guid>
		<description><![CDATA[we created sqljob but it is failing intermittently......with following error message

 Arithmetic overflow error converting expression to data type nvarchar. [SQLSTATE 22003] (Error 8115).  The step failed.
please find the code which we have created the job

CREATE  procedure [dbo].[auto_create_index]

as



/***********************************************************************

** File           :  auto_create_index.sql

**

** Name           :  auto_create_index

**

** Version        :  v1.1

**

** Desc           :  this is keep track of index susggestions.

**                   

**

**

** Called By SQL jobs     :  SQL MDW: Auto Index Management

**

** Calls          :  

**

** Uses           :   

**

** Author:          Gunag.

** Date:            12/04/2006







*******************************************************************************

**       CHANGE HISTORY

*******************************************************************************

**  Date         Author      Description

**  ----------   ---------   ---------------------------------------------------

*05/15/2009		v-drajan	 included sys.databases to avoid running this job during mssales transition [mssops 2-2519638337 ]

*06/01/2009		v-drajan	 add a condition to apply only for ONLINE DBs [mssops 2-2752950635 ]

******************************************************************************/





	--	NOTE: This sp will create indexes recommended by the Missing Index DMVs.

	--  	

	set nocount on



	-- required for creating index on ICC/IVs

	set ansi_warnings on

	set ansi_padding on

	set arithabort on

	set concat_null_yields_null on

	set numeric_roundabort off



	declare @exec_stmt nvarchar(6000)

	declare @table_name nvarchar(721)

	declare @column_name sysname

	declare @column_usage varchar(20)

	declare @column_id smallint

	declare @index_handle int

	declare @database_id int

	declare @object_id int



	-- find the top 5 indexes with maximum total improvent

	declare ms_cri_tnames cursor local static for

	Select Top 5 mid.database_id, mid.object_id, mid.statement as table_name, mig.index_handle as index_handle

	from 

	(

	select 

	(user_seeks+user_scans) * avg_total_user_cost * (avg_user_impact * 0.01) as index_advantage, migs.*

	from sys.dm_db_missing_index_group_stats migs

	) as migs_adv,

	sys.dm_db_missing_index_groups mig,

	sys.dm_db_missing_index_details mid,

    sys.databases mim

    where

	mid.database_id  = mim.database_id 

	and migs_adv.group_handle = mig.index_group_handle 

	and mig.index_handle = mid.index_handle

	and (mim.user_Access  1 and mim.is_read_only = 0 and mim.state =0)

	and migs_adv.index_advantage &gt; 10

	order by migs_adv.index_advantage DESC



	-- create temporary table to store the table names on which we just auto created indexes

	create table #tablenametab

	(	table_name  nvarchar(521) collate database_default 

	)



	truncate table #tablenametab



	open ms_cri_tnames

	fetch next from ms_cri_tnames into @database_id, @object_id, @table_name, @index_handle

	

	--print @table_name

	

	while (@@fetch_status  -1)

		begin

		-- don&#039;t auto create index on same table again

		-- UNDONE: we may try to filter out local temp table in the future

		if (@table_name not in (select table_name from #tablenametab ))

			begin

			-- these are all columns on which we are going to auto create indexes

			declare ms_cri_cnames cursor local for 

				select column_id, quotename(column_name,&#039;[&#039;), column_usage

				from sys.dm_db_missing_index_columns(@index_handle)

				

			-- now go over all columns for the index to-be-created and

			-- construct the create index statement

			open ms_cri_cnames

			fetch next from ms_cri_cnames into @column_id, @column_name, @column_usage

			

			declare @index_name sysname

			declare @include_column_list nvarchar(517)

			declare @key_list nvarchar(517)

			select @index_name = &#039;_MS_Sys&#039;

			select @key_list = &#039;&#039;

			select @include_column_list = &#039;&#039;

			declare @num_keys smallint

			declare @num_include_columns smallint

			select @num_keys = 0

			select @num_include_columns = 0



			while @@fetch_status &gt;= 0

			begin

				-- construct index name, key list and include column list during the loop

				-- Index Name in the format: _MS_Sys_colid1_colid2_..._colidn



				if (@column_usage = &#039;INCLUDE&#039;) 

					begin

					if (@num_include_columns = 0)

						select @include_column_list = @column_name			

					else

						select @include_column_list = @include_column_list + &#039;, &#039; +@column_name

					select @num_include_columns = @num_include_columns + 1

					end

				else 

					begin

					if (@num_keys = 0)

						select @key_list = @column_name

					else

						select @key_list = @key_list + &#039;, &#039; +@column_name



					select @num_keys = @num_keys + 1

					select @index_name = @index_name + &#039;_&#039;+cast ( @column_id as nvarchar(10))

					end

				

				fetch next from ms_cri_cnames into @column_id, @column_name, @column_usage

			end

			close ms_cri_cnames

			deallocate ms_cri_cnames

			--print @index_name

			--print @table_name

			--print @key_list

			--print @include_column_list

			-- construct create index statement

			-- &quot;CREATE INDEX @INDEX_NAME ON @TABLE_NAME (KEY_NAME1, KEY_NAME2, ...) INCLUDE (INCLUDE_COL_NAME1, INCLUDE_COL_NAME2, ...) WITH (ONLINE = ON)&quot; (Note: for recommendation mode, we don&#039;t use online option)

			if (@num_include_columns &gt; 0)

				select @exec_stmt = &#039;CREATE INDEX &#039; +  @index_name  + &#039; ON &#039; + @table_name + &#039;(&#039; + @key_list + &#039;) INCLUDE (&#039;+ @include_column_list + &#039;)&#039;-- WITH (ONLINE = ON)&#039;

			else

				select @exec_stmt = &#039;CREATE INDEX &#039; +  @index_name  + &#039; ON &#039; + @table_name + &#039;(&#039; + @key_list + &#039;)&#039;-- WITH (ONLINE = ON)&#039;

			--print @exec_stmt

			declare @id int

			declare @create_date datetime

			DECLARE @result int;

			

					BEGIN TRANSACTION xAddCreateIdxRecommendation

						EXEC @result = dbo.add_recommendation @exec_stmt, &#039;CI&#039;, @id OUT

						if (@result  10)

							EXEC dbo.add_recommendation_details_index @id, @database_id, @object_id 

							

						DECLARE @Error int

						SET @Error = @@ERROR

						IF @Error  0

							BEGIN

								ROLLBACK TRANSACTION xAddCreateIdxRecommendation

								RETURN @Error

							END	

						COMMIT TRANSACTION xAddCreateIdxRecommendation

						

			--EXEC (@exec_stmt)



			-- insert the table name into #tablenametab 

			insert into #tablenametab values (@table_name)

		end

		

		fetch next from ms_cri_tnames into @database_id, @object_id, @table_name, @index_handle

	

	end

	deallocate ms_cri_tnames



	return(0) -- auto_create_index





-------------------]]></description>
		<content:encoded><![CDATA[<p>we created sqljob but it is failing intermittently&#8230;&#8230;with following error message</p>
<p> Arithmetic overflow error converting expression to data type nvarchar. [SQLSTATE 22003] (Error 8115).  The step failed.<br />
please find the code which we have created the job</p>
<p>CREATE  procedure [dbo].[auto_create_index]</p>
<p>as</p>
<p>/***********************************************************************</p>
<p>** File           :  auto_create_index.sql</p>
<p>**</p>
<p>** Name           :  auto_create_index</p>
<p>**</p>
<p>** Version        :  v1.1</p>
<p>**</p>
<p>** Desc           :  this is keep track of index susggestions.</p>
<p>**                   </p>
<p>**</p>
<p>**</p>
<p>** Called By SQL jobs     :  SQL MDW: Auto Index Management</p>
<p>**</p>
<p>** Calls          :  </p>
<p>**</p>
<p>** Uses           :   </p>
<p>**</p>
<p>** Author:          Gunag.</p>
<p>** Date:            12/04/2006</p>
<p>*******************************************************************************</p>
<p>**       CHANGE HISTORY</p>
<p>*******************************************************************************</p>
<p>**  Date         Author      Description</p>
<p>**  &#8212;&#8212;&#8212;-   &#8212;&#8212;&#8212;   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>*05/15/2009		v-drajan	 included sys.databases to avoid running this job during mssales transition [mssops 2-2519638337 ]</p>
<p>*06/01/2009		v-drajan	 add a condition to apply only for ONLINE DBs [mssops 2-2752950635 ]</p>
<p>******************************************************************************/</p>
<p>	&#8211;	NOTE: This sp will create indexes recommended by the Missing Index DMVs.</p>
<p>	&#8211;  	</p>
<p>	set nocount on</p>
<p>	&#8211; required for creating index on ICC/IVs</p>
<p>	set ansi_warnings on</p>
<p>	set ansi_padding on</p>
<p>	set arithabort on</p>
<p>	set concat_null_yields_null on</p>
<p>	set numeric_roundabort off</p>
<p>	declare @exec_stmt nvarchar(6000)</p>
<p>	declare @table_name nvarchar(721)</p>
<p>	declare @column_name sysname</p>
<p>	declare @column_usage varchar(20)</p>
<p>	declare @column_id smallint</p>
<p>	declare @index_handle int</p>
<p>	declare @database_id int</p>
<p>	declare @object_id int</p>
<p>	&#8211; find the top 5 indexes with maximum total improvent</p>
<p>	declare ms_cri_tnames cursor local static for</p>
<p>	Select Top 5 mid.database_id, mid.object_id, mid.statement as table_name, mig.index_handle as index_handle</p>
<p>	from </p>
<p>	(</p>
<p>	select </p>
<p>	(user_seeks+user_scans) * avg_total_user_cost * (avg_user_impact * 0.01) as index_advantage, migs.*</p>
<p>	from sys.dm_db_missing_index_group_stats migs</p>
<p>	) as migs_adv,</p>
<p>	sys.dm_db_missing_index_groups mig,</p>
<p>	sys.dm_db_missing_index_details mid,</p>
<p>    sys.databases mim</p>
<p>    where</p>
<p>	mid.database_id  = mim.database_id </p>
<p>	and migs_adv.group_handle = mig.index_group_handle </p>
<p>	and mig.index_handle = mid.index_handle</p>
<p>	and (mim.user_Access  1 and mim.is_read_only = 0 and mim.state =0)</p>
<p>	and migs_adv.index_advantage &gt; 10</p>
<p>	order by migs_adv.index_advantage DESC</p>
<p>	&#8211; create temporary table to store the table names on which we just auto created indexes</p>
<p>	create table #tablenametab</p>
<p>	(	table_name  nvarchar(521) collate database_default </p>
<p>	)</p>
<p>	truncate table #tablenametab</p>
<p>	open ms_cri_tnames</p>
<p>	fetch next from ms_cri_tnames into @database_id, @object_id, @table_name, @index_handle</p>
<p>	&#8211;print @table_name</p>
<p>	while (@@fetch_status  -1)</p>
<p>		begin</p>
<p>		&#8211; don&#8217;t auto create index on same table again</p>
<p>		&#8211; UNDONE: we may try to filter out local temp table in the future</p>
<p>		if (@table_name not in (select table_name from #tablenametab ))</p>
<p>			begin</p>
<p>			&#8211; these are all columns on which we are going to auto create indexes</p>
<p>			declare ms_cri_cnames cursor local for </p>
<p>				select column_id, quotename(column_name,&#8217;[&#8216;), column_usage</p>
<p>				from sys.dm_db_missing_index_columns(@index_handle)</p>
<p>			&#8211; now go over all columns for the index to-be-created and</p>
<p>			&#8211; construct the create index statement</p>
<p>			open ms_cri_cnames</p>
<p>			fetch next from ms_cri_cnames into @column_id, @column_name, @column_usage</p>
<p>			declare @index_name sysname</p>
<p>			declare @include_column_list nvarchar(517)</p>
<p>			declare @key_list nvarchar(517)</p>
<p>			select @index_name = &#8216;_MS_Sys&#8217;</p>
<p>			select @key_list = &#8221;</p>
<p>			select @include_column_list = &#8221;</p>
<p>			declare @num_keys smallint</p>
<p>			declare @num_include_columns smallint</p>
<p>			select @num_keys = 0</p>
<p>			select @num_include_columns = 0</p>
<p>			while @@fetch_status &gt;= 0</p>
<p>			begin</p>
<p>				&#8211; construct index name, key list and include column list during the loop</p>
<p>				&#8211; Index Name in the format: _MS_Sys_colid1_colid2_&#8230;_colidn</p>
<p>				if (@column_usage = &#8216;INCLUDE&#8217;) </p>
<p>					begin</p>
<p>					if (@num_include_columns = 0)</p>
<p>						select @include_column_list = @column_name			</p>
<p>					else</p>
<p>						select @include_column_list = @include_column_list + &#8216;, &#8216; +@column_name</p>
<p>					select @num_include_columns = @num_include_columns + 1</p>
<p>					end</p>
<p>				else </p>
<p>					begin</p>
<p>					if (@num_keys = 0)</p>
<p>						select @key_list = @column_name</p>
<p>					else</p>
<p>						select @key_list = @key_list + &#8216;, &#8216; +@column_name</p>
<p>					select @num_keys = @num_keys + 1</p>
<p>					select @index_name = @index_name + &#8216;_&#8217;+cast ( @column_id as nvarchar(10))</p>
<p>					end</p>
<p>				fetch next from ms_cri_cnames into @column_id, @column_name, @column_usage</p>
<p>			end</p>
<p>			close ms_cri_cnames</p>
<p>			deallocate ms_cri_cnames</p>
<p>			&#8211;print @index_name</p>
<p>			&#8211;print @table_name</p>
<p>			&#8211;print @key_list</p>
<p>			&#8211;print @include_column_list</p>
<p>			&#8211; construct create index statement</p>
<p>			&#8211; &#8220;CREATE INDEX @INDEX_NAME ON @TABLE_NAME (KEY_NAME1, KEY_NAME2, &#8230;) INCLUDE (INCLUDE_COL_NAME1, INCLUDE_COL_NAME2, &#8230;) WITH (ONLINE = ON)&#8221; (Note: for recommendation mode, we don&#8217;t use online option)</p>
<p>			if (@num_include_columns &gt; 0)</p>
<p>				select @exec_stmt = &#8216;CREATE INDEX &#8216; +  @index_name  + &#8216; ON &#8216; + @table_name + &#8216;(&#8216; + @key_list + &#8216;) INCLUDE (&#8216;+ @include_column_list + &#8216;)&#8217;&#8211; WITH (ONLINE = ON)&#8217;</p>
<p>			else</p>
<p>				select @exec_stmt = &#8216;CREATE INDEX &#8216; +  @index_name  + &#8216; ON &#8216; + @table_name + &#8216;(&#8216; + @key_list + &#8216;)&#8217;&#8211; WITH (ONLINE = ON)&#8217;</p>
<p>			&#8211;print @exec_stmt</p>
<p>			declare @id int</p>
<p>			declare @create_date datetime</p>
<p>			DECLARE @result int;</p>
<p>					BEGIN TRANSACTION xAddCreateIdxRecommendation</p>
<p>						EXEC @result = dbo.add_recommendation @exec_stmt, &#8216;CI&#8217;, @id OUT</p>
<p>						if (@result  10)</p>
<p>							EXEC dbo.add_recommendation_details_index @id, @database_id, @object_id </p>
<p>						DECLARE @Error int</p>
<p>						SET @Error = @@ERROR</p>
<p>						IF @Error  0</p>
<p>							BEGIN</p>
<p>								ROLLBACK TRANSACTION xAddCreateIdxRecommendation</p>
<p>								RETURN @Error</p>
<p>							END	</p>
<p>						COMMIT TRANSACTION xAddCreateIdxRecommendation</p>
<p>			&#8211;EXEC (@exec_stmt)</p>
<p>			&#8211; insert the table name into #tablenametab </p>
<p>			insert into #tablenametab values (@table_name)</p>
<p>		end</p>
<p>		fetch next from ms_cri_tnames into @database_id, @object_id, @table_name, @index_handle</p>
<p>	end</p>
<p>	deallocate ms_cri_tnames</p>
<p>	return(0) &#8212; auto_create_index</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-149604</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 13:41:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-149604</guid>
		<description><![CDATA[Your application was not recognising it. Use single quotes around the value]]></description>
		<content:encoded><![CDATA[<p>Your application was not recognising it. Use single quotes around the value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rashmi</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-149508</link>
		<dc:creator><![CDATA[Rashmi]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 04:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-149508</guid>
		<description><![CDATA[Hello,

I have a field called id in a table of data type nvarchar(max).  when i use this field in stored procedure by applying id!=000111 in where condition,its working fine in sql 2005. but when i run the application its giving 

&#039;&#039;arithmetic overflow error converting nvarchar to data type numeric&#039;&#039; error.


Please help me...]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I have a field called id in a table of data type nvarchar(max).  when i use this field in stored procedure by applying id!=000111 in where condition,its working fine in sql 2005. but when i run the application its giving </p>
<p>&#8221;arithmetic overflow error converting nvarchar to data type numeric&#8221; error.</p>
<p>Please help me&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maddy</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-134634</link>
		<dc:creator><![CDATA[Maddy]]></dc:creator>
		<pubDate>Mon, 16 May 2011 17:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-134634</guid>
		<description><![CDATA[Hello,


Msg 8115, Level 16, State 6, Procedure Line 86
Arithmetic overflow error converting varchar to data type numeric.
 
when i execute this:

Exec REFINE 0,&#039;COTTON&#039;,1.1,100,8 

alter PROCEDURE [dbo].[REFINE]
      ( 
            @STOREID INT,
            @SEARCHKEYWORD VARCHAR(50),
            @FROMPRICE numeric(7,2),
            @TOPRICE numeric(7,2),
            @GARMENTID INT
            
      )
AS
DECLARE @SELECT   VARCHAR (5000)
DECLARE @ORDER  VARCHAR (255)
DECLARE @Criteria  VARCHAR (255) 

BEGIN
      SET NOCOUNT ON;

SELECT @Select = &#039;SELECT      product.sku  ,
                  product.name AS ProductName,
                  &#039;&#039;$&#039;&#039;+CONVERT(VARCHAR(20), Str((product.price/100.00), 12, 2)) as price, 
                  product.gender as genderID,   
                  CASE product.gender WHEN &#039;&#039;0&#039;&#039; Then &#039;&#039;Unisex&#039;&#039; WHEN &#039;&#039;1&#039;&#039; Then &#039;&#039;Female&#039;&#039; Else &#039;&#039;Male&#039;&#039; End as gender ,       
                  product.has_pockets as has_pocketsID,
                  CASE product.has_pockets WHEN &#039;&#039;1&#039;&#039; Then &#039;&#039;Yes&#039;&#039; Else &#039;&#039;No&#039;&#039; End AS has_pockets ,
                  Fabric_Blend.Fabric_Blend,
                  product.blendID,
                  Fabric_Texture.Fabric_Texture,
                  product.textureID AS textureID,
                Sleeve_Length.Sleeve_Length,
                  product.sleeveID,
                  Garment_Type.Garment_Type,
                  product.garmentID,
            Brands.brand_name,
                  product.brandID,
            store_product.storeID                           
                  FROM        product
                  INNER JOIN
                  store_product ON product.sku = store_product.sku 
                  INNER JOIN
                  Fabric_Texture ON product.textureID = Fabric_Texture.TextureID 
                  LEFT OUTER JOIN
                  Sleeve_Length ON product.sleeveID = Sleeve_Length.SleeveID 
                  INNER JOIN
                  Garment_Type ON product.garmentID = Garment_Type.GarmentID 
                  INNER JOIN
                  Brands ON product.brandID = Brands.BrandID 
                  INNER JOIN
                  Fabric_Blend ON product.blendID = Fabric_Blend.blendID
                  where store_product.storeID=&#039; + CONVERT(VARCHAR,@STOREID)

SELECT @ORDER = &#039; order by ProductName&#039;

SELECT @Criteria = &#039;&#039; 
      BEGIN
      IF @SEARCHKEYWORD IS NULL
            SELECT @Criteria = NULL
      ELSE
            IF @GARMENTID = 0 
            BEGIN
            SELECT @Criteria = @Criteria + &#039; AND product.name LIKE &#039; + CHAR(39) + &#039;%&#039; + @SEARCHKEYWORD+&#039;%&#039; + CHAR(39)  
            END
            ELSE
                  IF  CONVERT(numeric,@TOPRICE) = 0 AND CONVERT(numeric,@FROMPRICE)=0
                  BEGIN
                  SELECT @Criteria = @Criteria + &#039; AND product.name LIKE &#039; + CHAR(39) + &#039;%&#039; + @SEARCHKEYWORD+&#039;%&#039; + CHAR(39) + &#039; AND product.GARMENTID = &#039; + CONVERT(VARCHAR,@GARMENTID)
                  END
                  ELSE
                        IF CONVERT(numeric,@TOPRICE) = 0 
                        BEGIN
                        SELECT @Criteria = @Criteria + &#039; AND product.name LIKE &#039; + CHAR(39) + &#039;%&#039; + @SEARCHKEYWORD+&#039;%&#039; + CHAR(39)+ &#039; AND PRODUCT.GARMENTID = &#039; + CONVERT(VARCHAR,@GARMENTID) + &#039; AND SUBSTRING(CONVERT(VARCHAR,PRODUCT.PRICE), 2, LEN(CONVERT(VARCHAR,PRODUCT.PRICE)) - 2) &gt;= &#039; + CONVERT(numeric,@FROMPRICE)
                        END   
                        ELSE
                        SELECT @Criteria = @Criteria + &#039; AND product.name LIKE &#039; + CHAR(39) + &#039;%&#039; + @SEARCHKEYWORD+&#039;%&#039; + CHAR(39)+ &#039; AND PRODUCT.GARMENTID = &#039; + CONVERT(VARCHAR,@GARMENTID) + &#039; AND SUBSTRING(CONVERT(VARCHAR,PRODUCT.PRICE), 2, LEN(CONVERT(VARCHAR,PRODUCT.PRICE)) - 2) between &#039; + CONVERT(numeric,@FROMPRICE) + &#039; AND &#039; + CONVERT(numeric,@TOPRICE) 
      
      exec (@Select + @Criteria + @ORDER)
      END
END



GO]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Msg 8115, Level 16, State 6, Procedure Line 86<br />
Arithmetic overflow error converting varchar to data type numeric.</p>
<p>when i execute this:</p>
<p>Exec REFINE 0,&#8217;COTTON&#8217;,1.1,100,8 </p>
<p>alter PROCEDURE [dbo].[REFINE]<br />
      (<br />
            @STOREID INT,<br />
            @SEARCHKEYWORD VARCHAR(50),<br />
            @FROMPRICE numeric(7,2),<br />
            @TOPRICE numeric(7,2),<br />
            @GARMENTID INT</p>
<p>      )<br />
AS<br />
DECLARE @SELECT   VARCHAR (5000)<br />
DECLARE @ORDER  VARCHAR (255)<br />
DECLARE @Criteria  VARCHAR (255) </p>
<p>BEGIN<br />
      SET NOCOUNT ON;</p>
<p>SELECT @Select = &#8216;SELECT      product.sku  ,<br />
                  product.name AS ProductName,<br />
                  &#8221;$&#8221;+CONVERT(VARCHAR(20), Str((product.price/100.00), 12, 2)) as price,<br />
                  product.gender as genderID,<br />
                  CASE product.gender WHEN &#8221;0&#8221; Then &#8221;Unisex&#8221; WHEN &#8221;1&#8221; Then &#8221;Female&#8221; Else &#8221;Male&#8221; End as gender ,<br />
                  product.has_pockets as has_pocketsID,<br />
                  CASE product.has_pockets WHEN &#8221;1&#8221; Then &#8221;Yes&#8221; Else &#8221;No&#8221; End AS has_pockets ,<br />
                  Fabric_Blend.Fabric_Blend,<br />
                  product.blendID,<br />
                  Fabric_Texture.Fabric_Texture,<br />
                  product.textureID AS textureID,<br />
                Sleeve_Length.Sleeve_Length,<br />
                  product.sleeveID,<br />
                  Garment_Type.Garment_Type,<br />
                  product.garmentID,<br />
            Brands.brand_name,<br />
                  product.brandID,<br />
            store_product.storeID<br />
                  FROM        product<br />
                  INNER JOIN<br />
                  store_product ON product.sku = store_product.sku<br />
                  INNER JOIN<br />
                  Fabric_Texture ON product.textureID = Fabric_Texture.TextureID<br />
                  LEFT OUTER JOIN<br />
                  Sleeve_Length ON product.sleeveID = Sleeve_Length.SleeveID<br />
                  INNER JOIN<br />
                  Garment_Type ON product.garmentID = Garment_Type.GarmentID<br />
                  INNER JOIN<br />
                  Brands ON product.brandID = Brands.BrandID<br />
                  INNER JOIN<br />
                  Fabric_Blend ON product.blendID = Fabric_Blend.blendID<br />
                  where store_product.storeID=&#8217; + CONVERT(VARCHAR,@STOREID)</p>
<p>SELECT @ORDER = &#8216; order by ProductName&#8217;</p>
<p>SELECT @Criteria = &#8221;<br />
      BEGIN<br />
      IF @SEARCHKEYWORD IS NULL<br />
            SELECT @Criteria = NULL<br />
      ELSE<br />
            IF @GARMENTID = 0<br />
            BEGIN<br />
            SELECT @Criteria = @Criteria + &#8216; AND product.name LIKE &#8216; + CHAR(39) + &#8216;%&#8217; + @SEARCHKEYWORD+&#8217;%&#8217; + CHAR(39)<br />
            END<br />
            ELSE<br />
                  IF  CONVERT(numeric,@TOPRICE) = 0 AND CONVERT(numeric,@FROMPRICE)=0<br />
                  BEGIN<br />
                  SELECT @Criteria = @Criteria + &#8216; AND product.name LIKE &#8216; + CHAR(39) + &#8216;%&#8217; + @SEARCHKEYWORD+&#8217;%&#8217; + CHAR(39) + &#8216; AND product.GARMENTID = &#8216; + CONVERT(VARCHAR,@GARMENTID)<br />
                  END<br />
                  ELSE<br />
                        IF CONVERT(numeric,@TOPRICE) = 0<br />
                        BEGIN<br />
                        SELECT @Criteria = @Criteria + &#8216; AND product.name LIKE &#8216; + CHAR(39) + &#8216;%&#8217; + @SEARCHKEYWORD+&#8217;%&#8217; + CHAR(39)+ &#8216; AND PRODUCT.GARMENTID = &#8216; + CONVERT(VARCHAR,@GARMENTID) + &#8216; AND SUBSTRING(CONVERT(VARCHAR,PRODUCT.PRICE), 2, LEN(CONVERT(VARCHAR,PRODUCT.PRICE)) &#8211; 2) &gt;= &#8216; + CONVERT(numeric,@FROMPRICE)<br />
                        END<br />
                        ELSE<br />
                        SELECT @Criteria = @Criteria + &#8216; AND product.name LIKE &#8216; + CHAR(39) + &#8216;%&#8217; + @SEARCHKEYWORD+&#8217;%&#8217; + CHAR(39)+ &#8216; AND PRODUCT.GARMENTID = &#8216; + CONVERT(VARCHAR,@GARMENTID) + &#8216; AND SUBSTRING(CONVERT(VARCHAR,PRODUCT.PRICE), 2, LEN(CONVERT(VARCHAR,PRODUCT.PRICE)) &#8211; 2) between &#8216; + CONVERT(numeric,@FROMPRICE) + &#8216; AND &#8216; + CONVERT(numeric,@TOPRICE) </p>
<p>      exec (@Select + @Criteria + @ORDER)<br />
      END<br />
END</p>
<p>GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-101656</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 10:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-101656</guid>
		<description><![CDATA[Can you post the table structure? float can handle big numbers that you specified]]></description>
		<content:encoded><![CDATA[<p>Can you post the table structure? float can handle big numbers that you specified</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thuan Than</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-101068</link>
		<dc:creator><![CDATA[Thuan Than]]></dc:creator>
		<pubDate>Sat, 20 Nov 2010 08:21:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-101068</guid>
		<description><![CDATA[Very strange, I got this error in MS SQL SERVER 2008 Express R2: 
update ZC10CONGTRINH set TIENVNPSCO = 1234567890 + 1234567890
Whereas no error for this:
update ZC10CONGTRINH set TIENVNPSCO = 1234567890 + 12345678901
Please note that the second amount is bigger, but no error !
TIENVNCO &#039;s type is float.
This is real scenario because we use Vietnamse currency
Looking forward to your idea.... Thanks]]></description>
		<content:encoded><![CDATA[<p>Very strange, I got this error in MS SQL SERVER 2008 Express R2:<br />
update ZC10CONGTRINH set TIENVNPSCO = 1234567890 + 1234567890<br />
Whereas no error for this:<br />
update ZC10CONGTRINH set TIENVNPSCO = 1234567890 + 12345678901<br />
Please note that the second amount is bigger, but no error !<br />
TIENVNCO &#8216;s type is float.<br />
This is real scenario because we use Vietnamse currency<br />
Looking forward to your idea&#8230;. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-97151</link>
		<dc:creator><![CDATA[Yuri]]></dc:creator>
		<pubDate>Mon, 01 Nov 2010 11:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-97151</guid>
		<description><![CDATA[Lol, I did catch this one:

1&gt; select CONVERT (NUMERIC(7,3),-7.02000 );
2&gt; go
Msg 8115, Level 16, State 7, Server DRAFTMS, Line 1

No idea about this MS SQL %(]]></description>
		<content:encoded><![CDATA[<p>Lol, I did catch this one:</p>
<p>1&gt; select CONVERT (NUMERIC(7,3),-7.02000 );<br />
2&gt; go<br />
Msg 8115, Level 16, State 7, Server DRAFTMS, Line 1</p>
<p>No idea about this MS SQL %(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88646</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 21 Sep 2010 02:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88646</guid>
		<description><![CDATA[This is great point. I am not sure what has changed except looking deep into the code/data.]]></description>
		<content:encoded><![CDATA[<p>This is great point. I am not sure what has changed except looking deep into the code/data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Wyman</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88645</link>
		<dc:creator><![CDATA[Paul Wyman]]></dc:creator>
		<pubDate>Tue, 21 Sep 2010 02:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88645</guid>
		<description><![CDATA[Dave: 

Thanks for your quick reply. I understand your logic perfectly.  The problem, is that when the EXACT same tables are used in SQL Server 2008 R1 (10.0.1600.22) there is no problem. This same code works perfectly.  

Now just restore the identical tables to SQL Server 2008 R2, and we get the error. It&#039;s consistent it happens repeatedley in R2 (10.50.1600.1) and is does NOT happen in R1. 

The data are identical, the code is identical, R1 works great and R2 raises the stated error.   How can the data be causing the problem in this case?  I don&#039;t see how a .bak Restore from R1 into R2 can cause changes in data.   

Paul W.]]></description>
		<content:encoded><![CDATA[<p>Dave: </p>
<p>Thanks for your quick reply. I understand your logic perfectly.  The problem, is that when the EXACT same tables are used in SQL Server 2008 R1 (10.0.1600.22) there is no problem. This same code works perfectly.  </p>
<p>Now just restore the identical tables to SQL Server 2008 R2, and we get the error. It&#8217;s consistent it happens repeatedley in R2 (10.50.1600.1) and is does NOT happen in R1. </p>
<p>The data are identical, the code is identical, R1 works great and R2 raises the stated error.   How can the data be causing the problem in this case?  I don&#8217;t see how a .bak Restore from R1 into R2 can cause changes in data.   </p>
<p>Paul W.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88632</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 21 Sep 2010 01:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88632</guid>
		<description><![CDATA[It is the data which you are inserting would have changed not the SQL Server.]]></description>
		<content:encoded><![CDATA[<p>It is the data which you are inserting would have changed not the SQL Server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Wyman</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88568</link>
		<dc:creator><![CDATA[Paul Wyman]]></dc:creator>
		<pubDate>Mon, 20 Sep 2010 20:59:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-88568</guid>
		<description><![CDATA[10 years of SQL Server from 7 to 2008 and we never had any issues in our INSERT code.   

Moving into SQL Server 2008 R2, we immediately encounter  Msg. 8115 - Arithmetic overflow error converting tinyint to data type numeric. 

But the field being inserted was varchar not numeric !! 
for example:  
use Source Table 
insert into j5_Test_Inserts.dbo.jwjobs
(
  job_no
)
select
  job_no
from import_jobs

Any ideas? 
Thanks, 

Msg 8115, Level 16, State 6, Line 6
Arithmetic overflow error converting tinyint to data type numeric.

WHAT WAS THE CHANGE IN SQL SERVER 2008 R2 ??]]></description>
		<content:encoded><![CDATA[<p>10 years of SQL Server from 7 to 2008 and we never had any issues in our INSERT code.   </p>
<p>Moving into SQL Server 2008 R2, we immediately encounter  Msg. 8115 &#8211; Arithmetic overflow error converting tinyint to data type numeric. </p>
<p>But the field being inserted was varchar not numeric !!<br />
for example:<br />
use Source Table<br />
insert into j5_Test_Inserts.dbo.jwjobs<br />
(<br />
  job_no<br />
)<br />
select<br />
  job_no<br />
from import_jobs</p>
<p>Any ideas?<br />
Thanks, </p>
<p>Msg 8115, Level 16, State 6, Line 6<br />
Arithmetic overflow error converting tinyint to data type numeric.</p>
<p>WHAT WAS THE CHANGE IN SQL SERVER 2008 R2 ??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen Kumar</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-71868</link>
		<dc:creator><![CDATA[Praveen Kumar]]></dc:creator>
		<pubDate>Thu, 20 May 2010 16:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-71868</guid>
		<description><![CDATA[Hello,

I&#039;m having this same error but i get the error when running a Stored Procedure. I also noticed that I get the error only for a 10 day range in February. I can run the same stored procedure for all other date ranges this year and last year.  

I&#039;m not really sure how to determine the data field length in a Stored procedure, when the data is not getting outputted into a table.  

	,SUM(CASE WHEN QIV.PSRouteReasonId = 11 THEN DATEDIFF(second,QIV.PSBeginTime,QIV.PSEndTime) ELSE NULL END)		AS AvgTakenLastQueue
	,SUM(CASE WHEN QIV.PSRouteReasonId = 11 THEN DATEDIFF(second,QIV.QSQBeginTime,QIV.PSEndTime) ELSE NULL END)		AS AvgTakenContQueue

Those are the two lines that are giving me the error message. 

Any thoughts?

Thank you]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I&#8217;m having this same error but i get the error when running a Stored Procedure. I also noticed that I get the error only for a 10 day range in February. I can run the same stored procedure for all other date ranges this year and last year.  </p>
<p>I&#8217;m not really sure how to determine the data field length in a Stored procedure, when the data is not getting outputted into a table.  </p>
<p>	,SUM(CASE WHEN QIV.PSRouteReasonId = 11 THEN DATEDIFF(second,QIV.PSBeginTime,QIV.PSEndTime) ELSE NULL END)		AS AvgTakenLastQueue<br />
	,SUM(CASE WHEN QIV.PSRouteReasonId = 11 THEN DATEDIFF(second,QIV.QSQBeginTime,QIV.PSEndTime) ELSE NULL END)		AS AvgTakenContQueue</p>
<p>Those are the two lines that are giving me the error message. </p>
<p>Any thoughts?</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-64638</link>
		<dc:creator><![CDATA[Tejas Shah]]></dc:creator>
		<pubDate>Wed, 07 Apr 2010 04:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-64638</guid>
		<description><![CDATA[Hi Kena,

Query seems ok, It should run if that table exists in same database you run a query.

Could you please post an Error Description, so we can figure it out?

Thanks,

Tejas Shah]]></description>
		<content:encoded><![CDATA[<p>Hi Kena,</p>
<p>Query seems ok, It should run if that table exists in same database you run a query.</p>
<p>Could you please post an Error Description, so we can figure it out?</p>
<p>Thanks,</p>
<p>Tejas Shah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kena</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-64604</link>
		<dc:creator><![CDATA[Kena]]></dc:creator>
		<pubDate>Tue, 06 Apr 2010 18:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-64604</guid>
		<description><![CDATA[I am getting this error when I do 

select count(*) from tablename with(nolock).  Any idea why?

thank you
Kena]]></description>
		<content:encoded><![CDATA[<p>I am getting this error when I do </p>
<p>select count(*) from tablename with(nolock).  Any idea why?</p>
<p>thank you<br />
Kena</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deepak chauhan</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-61882</link>
		<dc:creator><![CDATA[deepak chauhan]]></dc:creator>
		<pubDate>Sat, 27 Feb 2010 11:59:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-61882</guid>
		<description><![CDATA[hello sir

i have a table &quot;trndetail&quot; which have three columns 

1=id
2=name
3= trndate

when i select a from the table as

select * from  trndetail
where trndate=2010-02-01

then out put is blank without any error while 
above date is exist in this table


pls tell me how can i do 


thnk u 


deepak chauhan]]></description>
		<content:encoded><![CDATA[<p>hello sir</p>
<p>i have a table &#8220;trndetail&#8221; which have three columns </p>
<p>1=id<br />
2=name<br />
3= trndate</p>
<p>when i select a from the table as</p>
<p>select * from  trndetail<br />
where trndate=2010-02-01</p>
<p>then out put is blank without any error while<br />
above date is exist in this table</p>
<p>pls tell me how can i do </p>
<p>thnk u </p>
<p>deepak chauhan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-48271</link>
		<dc:creator><![CDATA[Mike]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 16:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-48271</guid>
		<description><![CDATA[I am inserting into a temp table by doing 


select col1,col2,col3,...... into #t

select avg(col1) as ave from #t


I still get this error.]]></description>
		<content:encoded><![CDATA[<p>I am inserting into a temp table by doing </p>
<p>select col1,col2,col3,&#8230;&#8230; into #t</p>
<p>select avg(col1) as ave from #t</p>
<p>I still get this error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willem van Loon</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-16985</link>
		<dc:creator><![CDATA[Willem van Loon]]></dc:creator>
		<pubDate>Thu, 01 Nov 2007 10:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-16985</guid>
		<description><![CDATA[I used &#039;alter table XXX alter column XXX decimal (5,4) not null&#039; in SQL Server.]]></description>
		<content:encoded><![CDATA[<p>I used &#8216;alter table XXX alter column XXX decimal (5,4) not null&#8217; in SQL Server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willem van Loon</title>
		<link>http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-16984</link>
		<dc:creator><![CDATA[Willem van Loon]]></dc:creator>
		<pubDate>Thu, 01 Nov 2007 10:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/#comment-16984</guid>
		<description><![CDATA[In my case the fields are numeric with a comma: 99999,99 before change and 99999,9999 after change using a alter table.
I get sqlcode 8115 on it.

Do you now how I can realize this?

Yours truly,
Willem van Loon]]></description>
		<content:encoded><![CDATA[<p>In my case the fields are numeric with a comma: 99999,99 before change and 99999,9999 after change using a alter table.<br />
I get sqlcode 8115 on it.</p>
<p>Do you now how I can realize this?</p>
<p>Yours truly,<br />
Willem van Loon</p>
]]></content:encoded>
	</item>
</channel>
</rss>

