I have a table which holds only one column - an auto-incrementing primary key.
I need to insert values to this table in order to generate new ID.
Here is my table structure
CREATE TABLE [InvestmentJourneys]
(
[InvestmentJourneyId] [int] NOT NULL IDENTITY(1, 1)
CONSTRAINT [PK_InvestmentJourneys]
PRIMARY KEY CLUSTERED ([InvestmentJourneyId])
)
I've tried this:
INSERT INTO [InvestmentJourneys] ([InvestmentJourneyId])
VALUES (NULL)
But I get an error since this column is the primary key.
I would appreciate any suggestion here on how to achieve this.
Like so:
INSERT INTO dbo.InvestmentJourneys
DEFAULT VALUES;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.