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 translations Article translations
Article ID: 928966 - View products that this article applies to.
Expand all | Collapse all

On This Page

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 <TableName> : 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 "Applies to" 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

  1. Start Visual Studio 2005.
  2. On the File menu, click New, and then click Project.
  3. Expand Database Projects, and then click Microsoft SQL Server.
  4. Click SQL Server 2005, type Database1 in the Name box, and then click OK.
  5. In Solution Explorer, expand Schema Objects, right-click Tables, click Add, and then click Table.
  6. In the Name box, type TinyIntIdentity, and then click Add.
  7. 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]
  8. On the Data menu, click T-SQL Editor, and then click Execute SQL.
  9. In the Connect to Database dialog box, click the database connection in the Connection list, and then click OK.
  10. In Solution Explorer, right-click Data Generation Plans, click Add, and then click Data Generation Plan.
  11. In the Name box, type DataGenerationPlan1.dgen, and then click Add.
  12. Click to select the dbo.TinyIntIdentity check box, and then type 5000 in the Rows to Insert column.
  13. On the Data menu, click Data Generator, and then click Generate Data.
  14. In the Connect to Database dialog box, click the database connection in the Connection list, and then click OK.

Properties

Article ID: 928966 - Last Review: December 13, 2006 - Revision: 1.0
APPLIES TO
  • Microsoft Visual Studio 2005 Team Edition for Database Professionals
Keywords: 
kberrmsg kbpubtypekc kbtshoot kbprb KB928966

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com