default value for datetime field

Mar 25, 2011 at 2:58 PM

I have created a table in the nHydrate modeler.  One of the fields is a datatime column (timeLogged).  I tried to set the default value to:  getdate(), which is a T-SQL function that returns the current date time.

When I generated the database scripts, it failed to install, complaining about a ).  I cleared the getdate() from default, and it was happy.

How can i tell a datetime field to default to current date/time?

Coordinator
Mar 25, 2011 at 6:10 PM

Do not use method calls. set the default to "getdate" with no parenthesis. We will come up with a better way to denoting this.