当前位置: 网学 > 编程文档 > ASP > 正文

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

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17

以下是网学网为您推荐的ASP-SQL Server--怎样用ADO在SQL SERVER中建库,建表,希望本篇文章对您学习有所帮助。

通过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]

  • 上一篇资讯: 各种存储过程使用指南
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号