I have a SQL Server table defined as
CREATE TABLE [dbo].[Products]
(
[ProductId] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[Description] NVARCHAR (400) NOT NULL,
[Category] NVARCHAR (50) NOT NULL,
[Price] DECIMAL (18) NOT NULL,
PRIMARY KEY CLUSTERED ([ProductId] ASC)
);
Now my problem is that I have previously stored 7 items in the table with ID starting from 1 to 7 in sequence and when I add a new product in the table the ID automatically gets a random value like 1016, then for another new item it gets value 1017 and so on. How can I set ID value so that it automatically detect last stored ID and increment 1 in that value automatically?