The identity column must be of the int, bigint, smallint, tinyint, decimal or numeric data type with a scale of 0 and the column must not be null

advertisements

Using Visual Studio 2012 (VS2012) with SQL Server Data Tools (SSDT) I am receiving this error after attaching the database project to StarTeam 2009 R2 (I was previously working this project with no source control). The StarTeam 2009 R2 integration client for VS2012 has been installed for multiple weeks, but since putting the solution on the source control server, Visual Studio's performance has been seriously reduced (waiting 20-40 seconds for context menu to popup) and now this error which makes no sense to me.

SQL71518: The identity column '[Domain\Login].[temp#].[Id]' must be of data type int,
bigint, smallint, tinyint, decimal, or numeric with a scale of 0, and the column must
not be nullable.

As far as I can tell, there is nothing syntactically wrong with this code - though I may agree with lots of other issues...

CREATE TABLE [Domain\Login].[temp#]
(
    [Code]        VARCHAR (20)  NOT NULL,
    [Description] VARCHAR (255) NOT NULL,
    [Id]          INT           IDENTITY(1, 1)  NOT NULL
)

Any idea why the [Id] column is flagged with Error SQL71518? The column is of datatype int and is non-nullable, which meets the requirements mentioned in the error message.

This code was inherited from an outside vendor, who stopped supporting their product. Since the product was considered important to my company, they arranged to get the source code so we could support it ourselves. I'm relatively new to this particular project and the whole team knows that it has serious flaws; but we've not received the budget necessary to upgrade the code and fix all the design issues - only to perform some "minor" modifications, which should be unrelated to the above error. As such I'd ignore this error, but it is interfering with the VS2012 Database Schema Comparison utility.

Edit 1

SSDT for VS 2012 is already at 11.1.50730.0

SQL Server Data Tools   11.1.50730.0
Microsoft SQL Server Data Tools


The version of SSDT that comes with Visual Studio 2012 is very outdated, maybe that is why it works for everyone else?

Get a newer version of SSDT (2013 or 2015) and it should work - you don't have to pay for licenses you can get the one that comes with visual studio express or community.

ed