WEB开发网
开发学院数据库MSSQL Server MS SQL入门基础:创建数据库 阅读

MS SQL入门基础:创建数据库

 2007-01-03 09:20:41 来源:WEB开发网   
核心提示: 例6-1: 创建一个与上节中用Enterprise Manager 创建的数据库类似的数据库。 create database mydbon primary( name = mydb_data1,filename = 'd:sql datamydb_data1.mdf',s
例6-1: 创建一个与上节中用Enterprise Manager 创建的数据库类似的数据库。

create database mydb

on primary

( name = mydb_data1,

filename = 'd:sql datamydb_data1.mdf',

size = 1,

maxsize = unlimited,

filegrowth = 10% ),

filegroup data2

( name = mydb_data2,

filename = 'd:sql datamydb_data2.ndf',

size = 2,

maxsize = 100,

filegrowth = 1 ),

filegroup data3

( name = mydb_data3,

filename = 'd:sql datamydb_data3.ndf',

size = 3,

maxsize = 50,

filegrowth = 500kb )

log on

( name = 'mydb_log1',

filename = 'd:sql datamydb_log1.ldf',

size = 1mb,

maxsize = 25mb,

filegrowth = 10% ),

( name = 'mydb_log2',

filename = 'd:sql datamydb_log2.ldf',

size = 1mb,

maxsize = 10mb,

filegrowth = 10% ),

( name = 'mydb_log3',

filename = 'd:sql datamydb_log3.ldf',

size = 1mb,

maxsize = 5mb,

filegrowth = 512kb )

运行结果如下

-------------------- --------------------

The CREATE DATABASE process is allocating 1.00 MB on disk 'mydb_Data1'.

The CREATE DATABASE process is allocating 2.00 MB on disk 'mydb_Data2'.

The CREATE DATABASE process is allocating 3.00 MB on disk 'mydb_Data3'.

The CREATE DATABASE process is allocating 1.00 MB on disk 'mydb_Log1'.

The CREATE DATABASE process is allocating 1.00 MB on disk 'mydb_Log2'.

The CREATE DATABASE process is allocating 1.00 MB on disk 'mydb_Log3'.

查看全套"MS SQL入门基础教程">>>>>

上一页  1 2 3 4 5 

Tags:MS SQL 入门

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接