How to use ADO to build a library in SQL Server, build a table

Source: Internet
Author: User
Tags filegroup sql server books create database

How to use ADO to build a library in SQL Server, build a table

With ADO, you can access SQL Server and execute the appropriate SQL statements, build a table, and the following are the relevant definitions in SQL Server Books Online.

Build table:

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)

}

Build the Library:

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]




Related Article

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.