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]