Description of Access database Field Types and comparison with SQL

Source: Internet
Author: User
Text nvarchar (N)

Note ntext

Number (long integer) int

Integer smallint

Number (single precision) Real

Number (Double Precision) float

Number (byte) tinyint

Currency Money

Date smalldatetime

Boolean

Appendix: the script for converting to SQL.

Alter table tb alter column AA byte number [bytes]
Alter table tb alter column AA long number [long integer]
Alter table tb alter column AA short number [integer]
Alter table tb alter column AA single number [single precision
Alter table tb alter column AA double number [Double Precision]
Alter table tb alter column AA currency
Alter table tb alter column AA char text
Alter table tb alter column AA text (n) text, where n indicates the field size
Alter table tb alter column AA binary
Alter table tb alter column AA counter automatic number
Alter table tb alter column AA memo remarks
Alter table tb alter column aa time date/time

In the design view of a table, each field has a design type. Access allows nine data types: text, remarks, values, date/time, currency, automatic number, YES/NO, OLE object, hyperlink, query wizard.

Text: This type allows a maximum of 255 characters or numbers. The default size of access is 50 characters, and the system only saves the characters entered in the field, without saving empty characters in unused positions in text fields. You can set the "field size" attribute to control the maximum length of characters that can be entered.
Note: This type is used to save long texts and numbers. It allows fields to store up to 64000 characters of content. However, access does not support sorting or indexing remarks, but can sort and index text fields. Although text can be searched in the remarks field, it is not as fast as searching in the indexed text field.
Number: this field type can be used to store numeric data for arithmetic computation. You can also set the "field size" attribute to define a specific number type, any font that is specified as a digital data type can be set to "Byte", "integer", "Long Integer", "single precision", "Double Precision", "synchronous copy ID ", "decimal" five types. In access, the default value is "Double Precision ".
Date/time: this type is used to store date, time, or date and time. Each date/time field requires 8 bytes to store space.
Currency: This type is a special type of digital data. It is equivalent to the numeric field type with double-precision attributes. When entering data into the currency field, you do not need to enter the renminbi symbol and the comma at the thousands. Access will automatically display the renminbi symbol and comma, and add two decimal places to the currency field. When the fractional part is more than two digits, access rounds the data. The precision is 15 digits to the left of the decimal point and 4 digits to the right.
Automatic number: This type is special. Each time a new record is added to a table, access will automatically insert a unique sequence or random number, that is, specify a value in the automatic number field. Once the automatic number is specified, it is connected to the record permanently. If you delete a record that contains an automatically numbered field in the table, access does not re-number the table's automatically numbered field. When a record is added, access no longer uses the value of the deleted automatic number field, but re-assigns a value according to the increasing law.
Yes/No: this field is set for a field that contains only two different optional values. By using the format feature of yes/no data type, you can select the "yes" or "no" field.
OLE object: this field allows separate "Links" or "embedding" OLE objects. When adding data to the OLE object field, you can link or embed the OLE object in the Access Table to the object created by other Ole protocol programs, such as Word documents, Excel workbooks, images, sounds, or other binary data. The maximum value of the OLE object field is 1 GB, which is mainly restricted by disk space.
Hyperlink: this field is mainly used to save the hyperlink, including the text used as the hyperlink address or the combination of characters and numbers stored in the form of text. When you click a hyperlink, the Web browser or access will reach the specified target based on the hyperlink address. A hyperlink can contain up to three parts: one is the text displayed in a field or control, the other is the path to a file or page, and the other is the address in a file or page. The easiest way to insert a hyperlink address in this field or control is to click the hyperlink command in the Insert menu.
Query wizard: this field type provides a list of created fields. You can select the content listed in the List as the content of the added field.

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.