G
Guest
Hi everyone, and thanks for all the good tips. This is an awesome community
for Access developers. My question:
Is it possible, within the "CREATE TABLE" SQL syntax in Access (Jet 3.5 or
4.0), to define a default value for a field?
I have seen that this feature is supported in SQLServer's CREATE TABLE
syntax, but either I am implementing it incorrectly (it's been a long time
since I had to intrepret a formal language definition ;-), or DEFAULT is not
implemented in the Access/Jet SQL CREATE TABLE statement.
Here's what the documentation says for SQL Server:
CREATE TABLE
[ database_name.[ owner ] . | owner. ] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > } [ ,...n ]
)
....
< column_definition > ::= column_name data_type
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL]
[ < column_constraint > ] [ ...n ]
....
If CREATE TABLE has a DEFAULT capability in Jet then, pray tell, how do it
work?
Thanks in advance,
Ed
for Access developers. My question:
Is it possible, within the "CREATE TABLE" SQL syntax in Access (Jet 3.5 or
4.0), to define a default value for a field?
I have seen that this feature is supported in SQLServer's CREATE TABLE
syntax, but either I am implementing it incorrectly (it's been a long time
since I had to intrepret a formal language definition ;-), or DEFAULT is not
implemented in the Access/Jet SQL CREATE TABLE statement.
Here's what the documentation says for SQL Server:
CREATE TABLE
[ database_name.[ owner ] . | owner. ] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > } [ ,...n ]
)
....
< column_definition > ::= column_name data_type
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL]
[ < column_constraint > ] [ ...n ]
....
If CREATE TABLE has a DEFAULT capability in Jet then, pray tell, how do it
work?
Thanks in advance,
Ed