Complex defaults?

  • Is there an easy way to derive the default value for a given field using data from other fields or tables?  For example, by using a select statement?

  • I have never managed to use other field(s) to set the default value of a field, but there are other ways of doing it. You can use either User Defined Functions or Triggers to accomplish this. I prefer triggers since you then have the actual data that is being inserted and can react to set a "default" value appropriately.

    Hope this helps.


    ----------------------------------------
    Pascal Dobrautz
    www.sqlassi.net

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

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