CREATETABLE–SQLCommand
2008-04-02 10:49:46来源:互联网 阅读 ()
CREATE TABLE – SQL Command
Creates a table having the specified fields.wwww.chin aitpower.comem8Zf
CREATE TABLE | DBF TableName1 [NAME LongTableName] [FREE] (FieldName1 FieldType [(nFieldWidth [, nPrecision])] [NULL | NOT NULL] [CHECK lExpression1 [ERROR cMessageText1]] [DEFAULT eExpression1] [PRIMARY KEY | UNIQUE] [REFERENCES TableName2 [TAG TagName1]] [NOCPTRANS] [, FieldName2 ...] [, PRIMARY KEY eExpression2 TAG TagName2 |, UNIQUE eExpression3 TAG TagName3] [, FOREIGN KEY eExpression4 TAG TagName4 [NODUP] REFERENCES TableName3 [TAG TagName5]] [, CHECK lExpression2 [ERROR cMessageText2]])| FROM ARRAY ArrayName
Parameters
- TableName1
- Specifies the name of the table to create. The TABLE and DBF options are identical.
- NAME LongTableName
- Specifies a long name for the table. A long table name can be specified only when a database is open because long table names are stored in databases.
Long names can contain up to 128 characters and can be used in place of short file names in the database. wwww.chin aitpower.comem8Zf
- FREE
- Specifies that the table will not be added to an open database. FREE isn't required if a database isn't open.
- (FieldName1 FieldType [(nFieldWidth [, nPrecision])]
- Specifies the field name, field type, field width, and field precision (number of decimal places), respectively.
A single table can contain up to 255 fields. If one or more fields allow null values, the limit is reduced by one to 254 fields.
FieldType is a single letter indicating the field's data type. Some field data types require that you specify nFieldWidth or nPrecision, or both.
The following table lists the values for FieldType and whether nFieldWidth and nPrecision are required. wwww.chin aitpower.comem8Zf
FieldType nFieldWidth nPrecision Description C n – Character field of width n D – – Date T – – DateTime N n d Numeric field of width n with d decimal places F n d Floating numeric field of width n with d decimal places I – – Integer B – d Double Y – – Currency L – – Logical M – – Memo G – – General nFieldWidth and nPrecision are ignored for D, T, I, Y, L, M, G, and P types. nPrecision defaults to zero (no decimal places) if nPrecision isn't included for the N or F types. nPrecision defaults to the number of decimal places specified by the SET DECIMAL setting if nPrecision isn't included for the B type. wwww.chin aitpower.comem8Zf
- NULL
- Allows null values in the field. If one or more fields can contain null values, the maximum number of fields the table can contain is reduced by one, from 255 to 254.
- NOT NULL
- Prevents null values in the field.
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇: 如何恢复系统数据库?
下一篇: 实用的存储过程之二
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash