insert a table row where every column has a default

  • A co-worker just asked me a question, that got my head scratching. How do you insert a row in a table, where every column has a default value. He doesn't want to supply any data, just insert a row and let the defaults take over.

    Can something like this be done? What's the syntax?

    TIA

    Andre

  • --

    INSERT INTO T1 DEFAULT VALUES;

    --

    This is right out of the examples in Books Online for the INSERT statement. Sometimes it's as easy to RTFM as it is to ask a forum. 😉

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • You got me there. My bad.

  • No problem. Hope you didn't mind me poking a little fun.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply