50

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?

Community
  • 1
  • 1
Oomph Sonar
  • 783
  • 2
  • 8
  • 11

2 Answers2

129
INSERT INTO my_table DEFAULT VALUES 
gbn
  • 422,506
  • 82
  • 585
  • 676
3

Try to insert explicit null values:

INSERT INTO my_table VALUES (NULL, NULL);
Philipp
  • 67,764
  • 9
  • 118
  • 153