㈠ sql server怎样用代码建立数据库,详细代码

SQL语句在 Server中建立数据库_随着梦想去旅行_网络空间
http://hi..com/zhaquanmin/item/bd2d8216ccfdb8701009b5a1
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'suntest')
DROP DATABASE suntest
GO
CREATE DATABASE suntest
on
primary
(
name = suntest_data,
filename = 'e:\suntest_data.mdf',
size = 3,
maxsize = 10,
filegrowth = 10%
),
filegroup newgroup1
(
name = suntest_data,
filename = 'e:\suntest_data.mdf',
size = 3,
maxsize = 10,
filegrowth = 1
)
log on
(
name=suntest_log,
filename='e:\suntest_log.mdf',
size=1,
maxsize=6,
filegrowth=1
)
GO

发的连接里有更详尽的说明。

㈡ 数据库中实现一个表的代码

create table room
(type enum ('single','double','standard','luxurious'),
breakfast enum('none','chieftain','plicate'),
price int,
status enum('empty','full') ).