Insert a row into a table with just one column, primary key and id
2 answers
Try:
INSERT INTO dbo.TableOnlyPK DEFAULT VALUES
You have created the table below:
CREATE TABLE dbo.TableOnlyPK
(
Id tinyint PRIMARY KEY IDENTITY (1, 1)
)
Each time you run:, INSERT INTO dbo.TableOnlyPK DEFAULT VALUES
you insert one row into the IDENTITY column.
So if you do:
INSERT INTO dbo.TableOnlyPK DEFAULT VALUES
INSERT INTO dbo.TableOnlyPK DEFAULT VALUES
INSERT INTO dbo.TableOnlyPK DEFAULT VALUES
This will lead to:
+8
source to share