How to insert an empty line to SQL table? [duplica

2019-03-08 19:01发布

问题:

Possible Duplicate:
Inserting rows into a table with one IDENTITY column only

I have a SQL table with just one column. Column is an autoincrement field like:

Id INT IDENTITY

I need to insert a rows to this table (this is a bulk/dummy table temporarily):

INSERT INTO my_table VALUES ()

But I'm got a syntax error.

How can I do this?

回答1:

INSERT INTO my_table DEFAULT VALUES 


回答2:

Try to insert explicit null values:

INSERT INTO my_table VALUES (NULL, NULL);