-- ==============================
-- 长登科技 www.ppfor.com
-- 唐镇波   2010-04-20
-- ------------------------------
-- 会员等级类型表
-- ==============================

--创建会员等级类型表
if not exists(select name from sysobjects where name='PPFOR_TZB_DegreeType' and type='U')
CREATE TABLE [PPFOR_TZB_DegreeType] (
	[DegreeTypeID] int IDENTITY (1, 1) NOT NULL PRIMARY KEY,
	[DegreeTypeName] nvarchar (20) COLLATE Chinese_PRC_CS_AS NOT NULL unique,
	[DegreeNeedPoints] bit NOT NULL
)
PPFOR_GO;

--获取所有会员等级类型
if exists(select name from sysobjects where name='PPFOR_TZB_DegreeType_GetModelList' and type='P')
	drop procedure PPFOR_TZB_DegreeType_GetModelList
PPFOR_GO;
CREATE  procedure PPFOR_TZB_DegreeType_GetModelList
as
	SELECT [DegreeTypeID], [DegreeTypeName],[DegreeNeedPoints] FROM [PPFOR_TZB_DegreeType]
PPFOR_GO;

--获取会员等级类型
if exists(select name from sysobjects where name='PPFOR_TZB_DegreeType_GetModel' and type='P')
	drop procedure PPFOR_TZB_DegreeType_GetModel
PPFOR_GO;
create procedure PPFOR_TZB_DegreeType_GetModel(@ID int)
as
	SELECT [DegreeTypeID], [DegreeTypeName],[DegreeNeedPoints] FROM [PPFOR_TZB_DegreeType] 
		where [DegreeTypeID]=@ID
PPFOR_GO;


