if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CDadmin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CDadmin]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CDclass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CDclass]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[allorder]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[allorder]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[orders]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[orders]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_user]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CD]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CD]
GO
//管理员表
CREATE TABLE [dbo].[CDadmin] (
[AdminUser] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[AdminPass] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
//cd分类表
CREATE TABLE [dbo].[CDclass] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[ClassName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO
//订单管理表
CREATE TABLE [dbo].[allorder] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[orderId] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[CDNo] [int] NOT NULL ,
[Amount] [int] NULL
) ON [PRIMARY]
GO
//用户订单表
CREATE TABLE [dbo].[orders] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[orderId] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[UserId] [int] NOT NULL ,
[SubmitTime] [datetime] NOT NULL ,
[ConsignmentTime] [datetime] NULL ,
[TotalPrice] [float] NULL ,
[content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[IPAddress] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[IsPayoff] [int] NULL ,
[IsSales] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
//用户表
CREATE TABLE [dbo].[shop_user] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[UserName] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[PassWord] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[Names] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[Sex] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[Address] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
[Phone] [varchar] (25) COLLATE Chinese_PRC_CI_AS NULL ,
[Post] [varchar] (8) COLLATE Chinese_PRC_CI_AS NULL ,
[Email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[RegTime] [datetime] NULL ,
[RegIpAddress] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[userpoint] [int] NULL
) ON [PRIMARY]
GO
//cd信息表
CREATE TABLE [dbo].[CD] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[CDName] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[CDClass] [int] NOT NULL ,
[Singer] [varchar] (25) COLLATE Chinese_PRC_CI_AS NULL ,
[Publish] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
[CDNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[MusicList] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[Price] [float] NULL ,
[Amount] [int] NULL ,
[Leav_number] [int] NULL ,
[RegTime] [datetime] NOT NULL ,
[picture] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
//创建存储过程更新会员点数
create PROCEDURE dbo.updateUserPoint (@userid varchar(10),@point varchar(10))AS
declare @sql varchar(8000)
begin
set @sql='update shop_user set userpoint=userpoint+'+@point+' where id='+@userid ;
exec (@sql)
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>