数据库举例:
-
创建表[dbo]。[room type](
[PK][int]IDENTITY(1,1) NOT NULL,
[r _ type _ num][varchar](51)NOT NULL,
[room _ type][varchar](51)NOT NULL,
[bed][int]NOT NULL,
[price][float]NOT NULL,
[fore gift][float]NOT NULL,
[cl _ room][varchar](51)NOT NULL约束[DF _ rommtype _ cl _ room]DEFAULT(' N '),) ALLOW _ PAGE _ LOCKS = ON)[PRIMARY],
CONSTRAINT[IX _ room type]UNIQUE非聚集
(
[PK]ASC
)WITH(PAD _ INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW _ PAGE _ LOCKS = ON)[PRIMARY]
)ON[PRIMARY]
GO
SET ANSI _ PADDING OFF
GO
EXEC sys . sp _ addextended property @ name主键,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' PK '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '房间名简称,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' r _ type _ num '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '房间类型,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' room _ type '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '床位数,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' bed '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '单价,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' price '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '押金,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' fore gift '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '是否为钟点房,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ', @level2type=N'COLUMN ',@level2name=N'cl_room ',@value=N '钟点房房价,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' cl _ price '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '备注,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' remark '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '系统级标志,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' sysmark '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '删除标志,@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' del mark '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '其他' 1 ',@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@ level 2 name = N ' other 1 '
GO
EXEC sys . sp _ addextendedproperty @ name = N ' ms _ Description ',@value=N '其它2 ',@level1type=N'SCHEMA ',@level1name=N'dbo ',@level1type=N'TABLE ',@level1name=N'roomtype ',@level2type=N'COLUMN ',@level2name=N'other2'
GO对象:表[dbo]。 [注定]脚本日期:15/25/2112 15:56:12 ******/
在GO上设置ANSI _ NULLS
在GO上设置QUOTED _ IDENTIFIER
在GO上设置ANSI _ PADDING
创建表[dbo]。[destiny](
[PK][int]IDENTITY(1,1) NOT NULL,
[client _ name][varchar](51)NOT NULL,
[client _ tel][varchar](51)NOT NULL,
[room _ type _ id][varchar](51)NOT NULL,
[room _ no][varchar](51)NOT NULL,
[main _ room num][varchar](51)NOT NULL,
[pa _ time][datetime]NOT NULL,
[p]