序号 | 列名 | 数据类型 | 长度 | 小数位 | 标识 | 主键 | 外键 | 允许空 | 默认值 | 说明 |
1 | Gid | int | 4 | 0 | 是 | 是 | 否 | 帖子ID | ||
2 | Parentid | int | 4 | 0 | 否 | 0 | 所属帖子ID 标题贴ID | |||
3 | Cateid | int | 4 | 0 | 否 | 审核ID | ||||
4 | Userid | int | 4 | 0 | 否 | 发表人ID | ||||
5 | Title | varchar | 200 | 0 | 是 | 帖子标题 | ||||
6 | Tcontent | text | 16 | 0 | 否 | 帖子内容 | ||||
7 | Gdate | datetime | 8 | 3 | 是 | getdate | 发表时间 | |||
8 | Status | int | 4 | 0 | 否 | 0:未审核,1:已审核,-1回收站 | ||||
9 | IP | nvarchar | 50 | 0 | 是 | IP地址 |
留言表
GO
CREATE TABLE [dbo].[ZL_Guestbook](
[Gid] [int] IDENTITY(1,1) NOT NULL,
[Parentid] [int] NOT NULL,
[Cateid] [int] NOT NULL,
[Userid] [int] NOT NULL,
[Title] [nvarchar](200) NULL,
[Tcontent] [ntext] NOT NULL,
[Gdate] [datetime] NULL,
[Status] [int] NOT NULL,
[IP] [nvarchar](50) NULL,
CONSTRAINT [PK_ZL_GUESTBOOK] PRIMARY KEY CLUSTERED
(
[Gid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[ZL_Guestbook] ADD CONSTRAINT [DF_ZL_GUESTBOOK_PARENTID] DEFAULT ((0)) FOR [Parentid]
GO
ALTER TABLE [dbo].[ZL_Guestbook] ADD CONSTRAINT [DF_ZL_GUESTBOOK_GDATE] DEFAULT (getdate()) FOR [Gdate]
detele from ZL_Guestbook
drop table ZL_Guestbook
TRUNCATE table ZL_Guestbook