Microsoft KB Archive/234028

= BUG: sp_articleview May Generate an Arithmetic Overflow =

Article ID: 234028

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q234028



BUG #: 55703 (SQLBUG_70)



SYMPTOMS
sp_articleview creates the synchronization object for an article when a table is filtered vertically or horizontally. If the number of articles added to a published database exceed 32767, sp_articleview generates the following errors:

Server: Msg 220, Level 16, State 1, Procedure sp_articleview, Line 56

Arithmetic overflow error for data type smallint, value = 32768.

Server: Msg 20026, Level 11, State 1, Procedure sp_articleview, Line 59

The publication ' ' does not exist.

This system stored procedure is called when adding an article from Enterprise Manager, causing the add article process to fail with the same message.



CAUSE
This happens when the pubid in the syspublications table grows larger than 32767. Look for the syspublications table in the published database. The parameter @pubid, used in sp_articleview to obtain the syspublications pubid field, is defined as a smallint. However, the pubid column in syspublications is defined as an int. If the value in the syspublications table is greater than the largest possible value for a smallint (32767), an arithmetic overflow occurs when the system tries to place the data into the parameter.



WORKAROUND
The identity value for syspublications.pubid can become large when publications are created and dropped multiple times. Over time the current identity value may need to be corrected to avoid this error.

Check the largest publication pubid number in the database by issuing the following query: select max(pubid) from .dbo.syspublications If the value returned is less than 32767, run the following query in the database to correct the problem: declare @t1 int select @t1 = (select max(pubid) from .dbo.syspublications) + 1 DBCC CHECKIDENT(' .dbo.syspublications', RESEED, @t1)



STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0.

Keywords: kbbug kbpending KB234028

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.