Doubth in using Default Constraint...

  • Hi,

    I am creating a new Database. In this i will have a column for to store current Date.

    I can specify it as a default Constraint with GetDate() or ask the developers to insert it themselves.

    My doubt is which will give the best performance since the database will hold millions of records.

    Thanks in advance,

    Karthick

  • Best way to determine this is to setup a test environment and do it both ways. Using a default will alleviate the need for the developers to code for inserting the current date

    Just remember, a default is only used if the column isn't included in the INSERT. If it is included and an invalid or simply incorrect date (including NULL if permitted) will prevent the DEFAULT from being inserted.

Viewing 2 posts - 1 through 1 (of 1 total)

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