USE [MarketSale]
GO
/****** Object: Table [dbo].[Admin] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Admin](
[ID] [varchar](10) NOT NULL,
[User] [varchar](10) NOT NULL,
[Pwd] [varchar](50) NOT NULL,
[Right] [int] NOT NULL,
CONSTRAINT [PK_管理员] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Com] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Com](
[ID] [varchar](50) NOT NULL,
[BarCode] [nvarchar](50) NULL,
[Name] [nvarchar](50) NULL,
[Model] [nvarchar](50) NULL,
[Standard] [nvarchar](50) NULL,
[Type] [nvarchar](50) NULL,
[UMea] [nvarchar](50) NULL,
[Form] [nvarchar](50) NULL,
[Desc] [nvarchar](50) NULL,
[Use] [nvarchar](50) NULL,
[Area_Pro] [nvarchar](50) NULL,
[Remark] [nvarchar](50) NULL,
CONSTRAINT [PK_商品] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Ident] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Ident](
[ID_Ident] [varchar](50) NOT NULL,
[ID_Sup] [varchar](50) NULL,
[Type_Ord] [nvarchar](50) NULL,
[Money_Ord] [money] NULL,
[Date_Ord] [smalldatetime] NULL,
[Date_Arr] [smalldatetime] NULL,
[Orderer] [nvarchar](50) NULL,
CONSTRAINT [PK_订货单] PRIMARY KEY CLUSTERED
(
[ID_Ident] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[IdentDetail] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IdentDetail](
[Ser_Num] [varchar](50) NOT NULL,
[ID_Ident] [varchar](50) NULL,
[ID_Com] [varchar](50) NULL,
[Num] [int] NULL,
[UPrice] [money] NULL,
[Sum] [money] NULL,
CONSTRAINT [PK_订货明细] PRIMARY KEY CLUSTERED
(
[Ser_Num] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Invn] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Invn](
[ID_Com] [varchar](50) NOT NULL,
[ID_Sto] [varchar](50) NOT NULL,
[Alloc] [nvarchar](50) NULL,
[Num] [int] NULL,
[Pri_Pur] [money] NULL,
[Pri_Sell] [money] NULL,
[Date_Sto] [smalldatetime] NULL,
[Date_Pro] [smalldatetime] NULL,
[Date_Val] [smalldatetime] NULL,
[Sign] [nvarchar](50) NULL,
[Remark] [nvarchar](50) NULL,
CONSTRAINT [PK_库存商品] PRIMARY KEY CLUSTERED
(
[ID_Sto] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Mem] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Mem](
[ID_Mem] [varchar](50) NOT NULL,
[Name] [nvarchar](50) NULL,
[Sex] [nvarchar](50) NULL,
[BirthDay] [smalldatetime] NULL,
[Add] [nvarchar](50) NULL,
[Phone] [varchar](20) NULL,
[Pro] [nvarchar](50) NULL,
[ID_ID] [varchar](20) NULL,
[Date_Init] [smalldatetime] NULL,
CONSTRAINT [PK_会员] PRIMARY KEY CLUSTERED
(
[ID_Mem] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[RetBill] Script Date: 2017/1/5 21:05:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RetBill](
[�