在线建站培训
?客服
?搜索
您的位置: 维尼斯老虎机 网络编程 ASP编程 查看内容

SQL Server--怎样用ADO在SQL SERVER中建库,建表

2017-11-23 10:07 | 发布者: moke | 栏目:ASP编程

通过ADO可以访问SQL SERVER,并执行相应的SQL语句建库、建表,下面是SQL SERVER BOOKS ONLINE中的相关定义。

建表:

CREATE TABLE
[
database_name.[owner].
| owner.
] table_name
(
{
| column_name AS computed_column_expression

} [,...n]
)
[ON {filegroup | DEFAULT} ]
[TEXTIMAGE_ON {filegroup | DEFAULT} ]



::= { column_name data_type }
[ [ DEFAULT constant_expression ]
| [ IDENTITY [(seed, increment ) [NOT FOR REPLICATION] ] ]
]
[ ROWGUIDCOL ]
[ ] [ ...n]

::= [CONSTRAINT constraint_name]
{
[ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[CLUSTERED | NONCLUSTERED]
[WITH FILLFACTOR = fillfactor]
[ON {filegroup | DEFAULT} }
]
| [ [FOREIGN KEY]
REFERENCES ref_table [(ref_column) ]
[NOT FOR REPLICATION]
]
| CHECK [NOT FOR REPLICATION]
(logical_expression)
}

::= [CONSTRAINT constraint_name]
{
[ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED]
{ ( column[,...n] ) }
[ WITH FILLFACTOR = fillfactor]
[ON {filegroup | DEFAULT} ]
]
| FOREIGN KEY
[(column[,...n])]
REFERENCES ref_table [(ref_column[,...n])]
[NOT FOR REPLICATION]
| CHECK [NOT FOR REPLICATION]
(search_conditions)
}



建库:

CREATE DATABASE database_name
[ ON [PRIMARY]
[ [,...n] ]
[, [,...n] ]
]
[ LOG ON { [,...n]} ]
[ FOR LOAD | FOR ATTACH ]

::=

( [ NAME = logical_file_name, ]
FILENAME = 'os_file_name'
[, SIZE = size]
[, MAXSIZE = { max_size | UNLIMITED } ]
[, FILEGROWTH = growth_increment] ) [,...n]

::=

FILEGROUP filegroup_name [,...n]

维尼斯老虎机温馨提示:如果你想搭建一个地方门户或者社交论坛,那么到维尼斯老虎机的 discuz维尼斯老虎机 频道看看吧,这里有很多的地方门户和论坛维尼斯老虎机哦!

最新分享资源

最新评论

验证码 换一个

维尼斯老虎机,韦德老虎机,韦德1946老虎机

百度360搜索搜狗搜索