Default value in a table column...

mike55

Well-known member
Joined
Mar 26, 2004
Messages
726
Location
Ireland
Hi

When creating a table, you have the option of assigning a default value for a column. Is it possible to set the default value for a datatime column to the current date and time?

Mike55.
 
Sorry, should have provided more information: Database is SQL server 2000. Am trying to set the default value in the table design page of enterprise manager.

Yea GetDate() works, thanks.

Mike55
 
Is there a list of all the functions that I can put into the default value field available?

Mike55
 
Just had a quick look through Sql Server BOL and cant seem to find anything listing functions that can be used in the default value column. And, i have only ever set INT, VARCHAR and DATETIME defaults - of which DATETIME was the only one that required a function call to set the current date and time!
 
Yea, thats were I started searching originally, but came up with nothing of value, if I come across anything interesting, Ill let you know.

Mike55.
 
Back
Top