Create an Access Table using SQL statements

Source: Internet
Author: User
Create an Access Table using SQL statements
Author: Source: plwww Release Date: 2006.08.15

A long time ago, it took a day. There was no skill, but it was very practical. It was messy. Copy it to the notepad, remove the automatic line feed, and then it was organized :)
----------------------------------------------------------------------------
Type name type Remarks
----------------------------------------------------------------------------
Automatic number integer + identity (1, 1)
The number in the brackets of the text varchar (50) is the text length.
Long Integer
Integer short
Double, float
Single precision real
Byte
Fractional numeric (6, 2)
Currency Money
Note text
Date/time date, time, datetime
Yes/No bit
OLE object oleobject

----------------------------------------------------------------------------

Primary key
Required. Not null.
Default Value: default date ()
-----------------------------------------------------------------------------

Example
Description of Table Name field name type affiliated attributes
--------------------------------------------------------------------------------
Create Table mytable (m_id integer identity () primary key, -- auto-incrementing type, primary key
M_class varchar (50) not null default 'aaa', -- text, non-null, default value 'aaa'
M_int integer not null, -- long integer, non-null
M_numeric numeric (6, 2), -- decimal type
M_money money not null default 0.00, -- currency type, non-empty, default 0.00
M_memo text, -- Remark type
M_date date default date (), -- date type, default: current date
M_boolean bit default Yes, -- Boolean, yes by default
M_blob oleobject, -- blob type
M_double double, -- Double Type
M_float real) -- single precision type
Bytes ----------------------------------------------------------------------------------------------------------------------------

Create an index

Example 1
Create index myindex on mytable (m_class [DESC, ASC], m_int)
Example 2
Create unique index myindex on mytable (m_class) -- create a non-duplicate Index
Note: primary key fields are automatically created as non-duplicate indexes.

From, http://industry.ccidnet.com/art/1077/20051127/808651_1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.