Monday, March 12, 2012

how to set the default value

I have database in sql server. One field called datesent, i would like to set the default value as now(), i just type in the default value in database design, it didn't work. Please help, many thanks.try this: getdate()|||It works, thank you very much!|||I use the getdate() as the default value. But i found the value like "
11/8/2005 10:14:00 AM. How can i set the default value like the format as:
11/8/2005. Thanks.|||hi,

try this

create table yourTable
(
ColumnName datetime default convert(varchar,getdate(),107)
)

No comments:

Post a Comment