1

SQL Server 2014

Given a table 'test' with the following fields:

  • id: int. Primary key. Autoincrement by 1.
  • creation_date: datetime. GETDATE() by default value.

My intention is to insert an empty statement, just to register the event of the insertion. I thought that as the id is an autoincrement and the creation_date has a value by default, a record could be inserted without specifying any value. I know that this can be done by adding a third field and specifying the value in the insertion, but my question is:

Can something like a plain INSERT INTO test be done?

Thanks

3
  • 2
    insert into test values (default, default) Commented Oct 23, 2017 at 13:03
  • 1
    or How to insert default values in SQL table? Commented Oct 23, 2017 at 13:07
  • thanks for the fast replies Commented Oct 23, 2017 at 13:10

1 Answer 1

4
INSERT INTO test DEFAULT VALUES
Sign up to request clarification or add additional context in comments.

1 Comment

thank you for the fast reply

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.