表名:ZL_Guestbook












序号列名数据类型长度小数位标识主键外键允许空默认值说明
1Gidint40  帖子ID
2Parentidint40   0所属帖子ID 标题贴ID
3Cateidint40    审核ID
4Useridint40    发表人ID
5Titlevarchar2000    帖子标题
6Tcontenttext160    帖子内容
7Gdatedatetime83   getdate发表时间
8Statusint40    0:未审核,1:已审核,-1回收站
9IPnvarchar500    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

--注意:清空且复位表ID序列为初始值

TRUNCATE table ZL_Guestbook