Reputation: 10297
The Server Explorer Table creation facility automatically adds an Id column to each Table you create:
But I noticed that, although it is indeed set as a PRIMARY KEY, it does not specify that it is an AutoInc column.
So I added that directly to the T-SQL tab, but that is considered a syntax error:
Is it already an auto-inc, and I don't need to specify it as such, or if I do need to, what am I doing wrong?
Upvotes: 0
Views: 195
Reputation: 1909
In SQL Server, it's not an AUTO_INCREMENT, it's an identity:
CREATE TABLE dbo.Genres
(
[GenreId] INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
[Genre] VARCHAR(20) NULL
);
Upvotes: 7