mssql2000 database execution SQL statements to create databases and data tables and indexes
Create a database MSsql2000
Create DATABASE DatabaseName on Primary
(Name= ' databasename_data ', filename= ' C:\databasename_data.mdf ', size=3mb,maxsize=unlimited,filegrowth=10%) log on
(Name= ' Databasename_log ', filename= ' C:\databasename_log.ldf ', size=3mb,filegrowth=10%)
CREATE DATABASE [dbname] on PRIMARY (NAME = n ' dbname_data ', FILENAME = N ' C:\dbname_data.mdf ', SIZE = 3072KB, MAXSIZE =
UNLIMITED, filegrowth = 1024KB) LOG on (NAME = n ' dbname_log ', FILENAME = N ' C:\dbname_log.ldf ', SIZE = 1024KB, MAXSIZE =
UNLIMITED, filegrowth = 10%) COLLATE Chinese_prc_90_cs_ai
Deleting a database
Drop database DatabaseName
Create a data table
CREATE TABLE [dbo]. [T_rewards] (
[ID] [int] IDENTITY (1, 1) not NULL,
[ItemName] [nvarchar] (COLLATE) Chinese_prc_ci_as NULL,
[Itemnum] [INT] Null
[Radbig] [INT] Null
[Radsmall] [INT] Null
[Uptable] [nvarchar] (COLLATE) Chinese_prc_ci_as NULL,
[Uptype] [tinyint] Null
) on [PRIMARY]
Create primary key Alter table T_rewards Add primary key (ID)
Delete primary key Alter table T_rewards drop PRIMARY key (ID)
Creating an index create unique index pk_t_rewardsuptype on t_rewards (Uptype)
Drop Index Pk_t_rewardsuptype on t_rewards
Drop Index T_rewards. Pk_t_rewardsuptype
Create a unique index ALTER TABLE t_rewards add constraint pk_t_rewardsitemname unique (itemname)
mssql2000 database execution SQL statements to create databases and data tables and indexes