怎样用 Transact-SQL语言在SQL2000中创建数据库
发布网友
发布时间:2022-04-13 08:30
我来回答
共4个回答
热心网友
时间:2022-04-13 09:59
use master
go
if exists(select * from sysdatabases where name='aaa')
drop database aaa
create database aaa
on
(
name='aaa1',
filename='D:\project\aaa1_data.mdf',
size=10,
filegrowth=10%
)
(
name='aaa2',
filename='D;\project\aaa2_data.ndf',
size=20,
masxsize=100,
filegrowth=1
)
log on
(
name='aaalog',
filename='D:\project\aaalog_log.ldf',
size=10,
filegrowth=1
)
(
name='aaa1log',
filename='D:\project\aaa1log_log.ldf',
size=10,
masxsize=50,
filegrowth=1
)
热心网友
时间:2022-04-13 11:17
创建数据库表的一个例子
CREATE TABLE publishers(pub_id char(4) NOT NULL CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTEREDCHECK (pub_id IN ('1389', '0736', '0877', '1622', '1756')OR pub_id LIKE '99[0-9][0-9]'),pub_name varchar(40) NULL,city varchar(20) NULL,state char(2) NULL,country varchar(30) NULLDEFAULT('USA'))
热心网友
时间:2022-04-13 12:52
下面是我在一个里面看的CREATE TABLE publishers(pub_id char(4) NOT NULL CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTEREDCHECK (pub_id IN ('1389', '0736', '0877', '1622', '1756')OR pub_id LIKE '99[0-9][0-9]'),pub_name varchar(40) NULL,city varchar(20) NULL,state char(2) NULL,country varchar(30) NULLDEFAULT('USA'))