程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> CREATETABLE–SQLCommand

CREATETABLE–SQLCommand

編輯:關於SqlServer

CREATE TABLE – SQL Command

Creates a table having the specified fIElds.

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.

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.

FIEldType
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved