45

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
  • 713
  • 2
  • 8
  • 11

2 Answers2

122
INSERT INTO my_table DEFAULT VALUES 
gbn
  • 408,740
  • 77
  • 567
  • 659
3

Try to insert explicit null values:

INSERT INTO my_table VALUES (NULL, NULL);
Philipp
  • 64,526
  • 9
  • 115
  • 146