Jump to content

How Create A Numeric Field With Default Value Using Create Table


wilsonf1
 Share

Recommended Posts

In asp i am creating tables inside an access DB no problem:"file_name text(100), " & _"template text(50), " & _"meta_title text(70)," & _the above is fine - but i need a numeric/bit field with a default value of 1 for my site map column - how do you do it? ive tried so many syntax's with errors:"site_map integer NOT NULL default 1, " & "site_map numeric NOT NULL default '1', " & HELP!!!

Link to comment
Share on other sites

hmmm nothing in the access help about default value - would that mean its not possible then?SyntaxCREATE [TEMPORARY] TABLE table (field1 type [(size)] [NOT NULL] [WITH COMPRESSION | WITH COMP] [index1] [, field2 type [(size)] [NOT NULL] [index2] [, ...]] [, CONSTRAINT multifieldindex [, ...]])The CREATE TABLE statement has these parts:Part Description table The name of the table to be created. field1, field2 The name of field or fields to be created in the new table. You must create at least one field. type The data type of field in the new table. size The field size in characters (Text and Binary fields only). index1, index2 A CONSTRAINT clause defining a single-field index. multifieldindex A CONSTRAINT clause defining a multiple-field index.

Link to comment
Share on other sites

I don't see anything about setting a default, I'm not sure if it's possible or not in Access. I haven't used Access in 7 or 8 years, I'm not sure what is allowed in the SQL statements. You should be able to set a default using the GUI though, if I remember correctly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...