SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Role]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Role](
[ID] [int] IDENTITY(1,1) NOT NULL,
[RoleName] [varchar](50) NULL,
CONSTRAINT [PK_Role] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Pictures]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Pictures](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Desn] [varchar](200) NULL,
[Type] [varchar](100) NULL,
[Data] [image] NULL,
[Date] [datetime] NULL,
CONSTRAINT [PK_Pictures] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Category]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Category](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Desn] [varchar](200) NULL,
[ParentID] [int] NULL,
[OrderBy] [int] NULL,
[Remark] [text] NULL,
CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Notify]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Notify](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Desn] [varchar](200) NULL,
[Body] [text] NULL,
[Date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Users]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Users](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserName] [varchar](50) NULL,
[RealName] [varchar](50) NULL,
[Password] [varchar](255) NULL,
[Address] [varchar](200) NULL,
[Phone] [varchar](20) NULL,
[Mobile] [varchar](20) NULL,
[Email] [varchar](200) NULL,
[CreateDate] [datetime] NULL,
[Status] [bit] NULL,
[RoleID] [int] NULL,
[Remark] [text] NULL,
CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Leaveword]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Leaveword](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Desn] [varchar](50) NULL,
[Body] [text] NULL,
[Date] [datetime] NULL,
[UserID] [int] NULL,
CONSTRAINT [PK_Leaveword] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OrderForm]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[OrderForm](
[ID] [int] IDENTITY(1,1) NOT NULL,
[OrderNo] [varchar](50) NULL,
[UserID] [int] NULL,
[TotalNumber] [int] NULL,
[TotalMoney] [money] NULL,
[OrderDate] [datetime] NULL,
[State] [int] NULL,
CONSTRAINT [PK_OrderForm] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Comment]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Comment](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Desn] [varchar](50) NULL,
[Body] [text] NULL,
[Date] [datetime] NULL,
[UserID] [int] NULL,
[ProductID] [int] NULL,
CONSTRAINT [PK_Comment] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAG�
评论6