Psst! Check what courses we have in our offer, and get them all here to save $727. Tick-tock—this deal ends on 3/21.
Introduction
Default values
7. INSERT using DEFAULT for all columns
How to auto-generate values in a database
Summary

Instruction

Amazing! What about using DEFAULT for all columns? You can use a statement like this:

INSERT INTO AllDefaultsTable VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT);

T-SQL again allows you to use a shorter query:

INSERT INTO AllDefaultsTable DEFAULT VALUES;

Using DEFAULT for every table column is a very rare case, so we don't need to discuss it in detail. Just remember that you can use this syntax if needed.

Exercise

Click Next exercise to continue.