Wednesday, March 7, 2012

how to set default value for datetime column in sql mobile?

I try to set a default value (getdate()) for a datetime culomn in sql mobile,
but got error when i insert record:

there was a syntax error in the date format. [expression = getdate()]

may be I can only set a exict date ?

I can repro the failure you are seeing. On Searching BOL for sql mobile, It says the following about the default definitions for columns.

DEFAULT Definitions

A column can have only one DEFAULT definition. This can contain constant values or constant functions.

You should post this to the SQL Server Everywhere/Mobile/CE Edition Technical Discussion forum.

No comments:

Post a Comment