• Toreador (5/3/2013)


    Danny Ocean (5/2/2013)


    Most of people don't know about it because it's not in use in any real scenario.

    Sure it is, if the table contains other columns, all with defaults.

    As a simplistic example:

    CREATE TABLE TableA(ID INT IDENTITY (1,1),

    LastUpdated datetime default (getdate()))

    I don't use this technique often, but have used it in production systems before.

    ... what Mr. Ocean meant was to use the defaults with the combination of identity column.

    (the example what you have given is very nice and we have that set up in the prod server for one database. it actually reduces couple of parameters while inserting - createdate or updating the date)

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.