You are here: Re: UPDATE on a column with a set default « MsSQL Server « IT news, forums, messages
Re: UPDATE on a column with a set default

Posted by me321701 on 01/31/06 02:51

Unless you are controlling all avenues of database access, default
values do NOT ensure that a value is reset on insert or update.
Default only applies if no value is provided.

If you're looking to provide the date a row was inserted or updated,
then a trigger is a valid choice. And they work fine for this.

Mark

On Mon, 30 Jan 2006 12:47:03 -0700, Mike Husler
<Michael.P.Husler@noaa.gov> wrote:

>If we have a column with a default value set, say GETDATE( ), how can we
>assure that value is reset on an UPDATE (not an INSERT) without changing
>the client code that does the updating?
>I'd rather stay away from triggers, etc if possible.
>
>Thanks,
>Mike Husler

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация