Microsoft KB Archive/928966

= You may receive an error message when you try to populate a table by using a data generation plan in Visual Studio 2005 Team Edition for Database Professionals =

Article ID: 928966

Article Last Modified on 12/13/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Team Edition for Database Professionals

-



SYMPTOMS
When you try to populate a table by using a data generation plan in Microsoft Visual Studio 2005 Team Edition for Database Professionals, you may receive an error message that resembles the following:

Table  : System.Data.SqlClient.SqlError: Arithmetic overflow error converting IDENTITY to data type tinyint.



CAUSE
This problem occurs because Visual Studio 2005 Team Edition for Database Professionals does not validate if the number of rows that are added by the data generation plan exceeds the maximum number of rows that are permitted in an identity column.



WORKAROUND
To work around this problem, make sure that the number of rows that are added by the data generation plan does not exceed the maximum number of rows that are permitted in an identity column.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
For more information about integer data types in Microsoft SQL Server, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/ms187745.aspx

Steps to reproduce the problem
 Start Visual Studio 2005. On the File menu, click New, and then click Project. Expand Database Projects, and then click Microsoft SQL Server. Click SQL Server 2005, type Database1 in the Name box, and then click OK. In Solution Explorer, expand Schema Objects, right-click Tables, click Add, and then click Table. In the Name box, type TinyIntIdentity, and then click Add.</li>  In the dbo.TinyIntIdentity.table.sql file, replace the existing code by using the following code. CREATE TABLE [dbo].[TinyIntIdentity] ( [Tiny_Identity] [tinyint] NOT NULL IDENTITY(1, 2), [UselessData] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CS_AS NULL ) ON [PRIMARY] </li> On the Data menu, click T-SQL Editor, and then click Execute SQL.</li> In the Connect to Database dialog box, click the database connection in the Connection list, and then click OK.</li> In Solution Explorer, right-click Data Generation Plans, click Add, and then click Data Generation Plan.</li> In the Name box, type DataGenerationPlan1.dgen, and then click Add.</li> Click to select the dbo.TinyIntIdentity check box, and then type 5000 in the Rows to Insert column.</li> On the Data menu, click Data Generator, and then click Generate Data.</li> In the Connect to Database dialog box, click the database connection in the Connection list, and then click OK.</li></ol>

Keywords: kberrmsg kbpubtypekc kbtshoot kbprb KB928966

-

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

© Microsoft Corporation. All rights reserved.