How to insert row a in one column (PK)?

I have a table with one and only one column, which is the identity column (PK) of this table. How to insert a row into this table?

INSERT INTO table_name 

not working, also:

INSERT INTO table_name() VALUES()

VALID RESPONSE FROM ANSWER:

INSERT INTO table_name DEFAULT VALUES
+3
source share
2 answers
DECLARE @TABLE TABLE
(
    ID INT IDENTITY(1,1) PRIMARY KEY 
)

INSERT INTO @TABLE DEFAULT VALUES

SELECT * FROM @TABLE
+4
source

You must include an identifier in the table so that you can insert values ​​into the column.

SET IDENTITY_INSERT table_name ON
+1
source

Source: https://habr.com/ru/post/1744243/


All Articles