Joekoe_CMS_1.sql


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[joekoe_forum_fir]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[joekoe_forum_fir]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[joekoe_forum_list_main]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[joekoe_forum_list_main]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[joekoe_forum_main]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[joekoe_forum_main]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[joekoe_forum_view]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[joekoe_forum_view]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[admin_event]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[admin_event]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[admin_menu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[admin_menu]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ads]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ads]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ads_txt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ads_txt]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[article]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[article]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_cast]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_cast]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_class]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_class]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_data]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_data]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_event]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_event]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_forum]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_forum]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_topic]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_topic]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bbs_vote]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[bbs_vote]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cards]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[cards]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[configs]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[configs]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[down]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[down]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[down_code]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[down_code]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[gallery]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[gallery]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[gb_data]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[gb_data]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[jk_class]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[jk_class]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[jk_group]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[jk_group]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[jk_sort]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[jk_sort]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[links]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[links]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[news]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[notes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[notes]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[notes_emoney]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[notes_emoney]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[review]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[review]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_cast]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_cast]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_emoney_notes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_emoney_notes]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_oorders]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_oorders]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_orders]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_orders]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[shop_product]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[shop_product]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[upload]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[upload]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user_bookmark]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user_bookmark]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user_data]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user_data]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user_friend]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user_friend]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user_login]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user_login]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user_mail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user_mail]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vote]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[vote]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vouch]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[vouch]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[website]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[website]
GO

Create TABLE [dbo].[admin_event] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [nname] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [ip] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
    [sys] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[admin_menu] (
    [m_id] [int] IDENTITY (1, 1) NOT NULL ,
    [m_sort] [int] NULL ,
    [m_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_order] [int] NULL ,
    [m_open] [bit] NULL ,
    [m_hidden] [bit] NULL ,
    [m_is_master] [bit] NULL ,
    [m_is_nsort] [bit] NULL ,
    [m_is_review] [bit] NULL ,
    [m_popedom] [int] NULL ,
    [m_nsort] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_index_url] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_data_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_tit] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_tit_fir] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_is_menu] [bit] NULL ,
    [m_morder] [int] NULL ,
    [m_mname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_mtit] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_mcolor] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [m_mb] [bit] NULL ,
    [m_mtarget] [bit] NULL ,
    [m_murl] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[ads] (
    [aid] [int] IDENTITY (1, 1) NOT NULL ,
    [asort] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [asize] [bit] NULL ,
    [awidth] [int] NULL ,
    [aheight] [int] NULL ,
    [atype] [int] NULL ,
    [aname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [alink] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [aurl] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [acounter] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[ads_txt] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [nsort] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [head] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [tit] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[article] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [counter] [int] NULL ,
    [tim] [datetime] NULL ,
    [hidden] [bit] NULL ,
    [power] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [emoney] [int] NULL ,
    [author] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [comto] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [keyes] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [istop] [int] NULL ,
    [cod] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_cast] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [sort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_class] (
    [class_id] [int] IDENTITY (1, 1) NOT NULL ,
    [class_order] [int] NULL ,
    [class_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_data] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [forum_id] [int] NULL ,
    [reply_id] [int] NULL ,
    [userid] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [icon] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [ip] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
    [sys] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_event] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [forum_id] [int] NULL ,
    [topic_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [o_user] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [integral] [int] NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_forum] (
    [forum_id] [int] IDENTITY (1, 1) NOT NULL ,
    [class_id] [int] NULL ,
    [forum_order] [int] NULL ,
    [forum_f] [int] NULL ,
    [forum_n] [int] NULL ,
    [forum_w] [bit] NULL ,
    [forum_star] [int] NULL ,
    [forum_parent] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_remark] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_power] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_pic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_type] [int] NULL ,
    [forum_hidden] [bit] NULL ,
    [forum_pro] [int] NULL ,
    [forum_topic_num] [int] NULL ,
    [forum_data_num] [int] NULL ,
    [forum_new_info] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [forum_new_num] [int] NULL ,
    [forum_config] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_topic] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [forum_id] [int] NULL ,
    [userid] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [tcolor] [nvarchar] (7) COLLATE Chinese_PRC_CI_AS NULL ,
    [tbb] [bit] NULL ,
    [icon] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [counter] [int] NULL ,
    [re_username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [re_counter] [int] NULL ,
    [re_tim] [datetime] NULL ,
    [istop] [smallint] NULL ,
    [islock] [smallint] NULL ,
    [isgood] [smallint] NULL ,
    [isvote] [bit] NULL ,
    [vote_num] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[bbs_vote] (
    [v_id] [int] IDENTITY (1, 1) NOT NULL ,
    [reply_id] [int] NULL ,
    [v_name] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [v_num] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [v_type] [bit] NULL ,
    [v_tim] [datetime] NULL ,
    [v_day] [int] NULL ,
    [v_username] [ntext] COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[cards] (
    [c_id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [c_pass] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [c_emoney] [int] NULL ,
    [c_hidden] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[configs] (
    [id] [int] NOT NULL ,
    [num_topic] [int] NULL ,
    [num_data] [int] NULL ,
    [num_reg] [int] NULL ,
    [new_username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [num_news] [int] NULL ,
    [num_article] [int] NULL ,
    [num_down] [int] NULL ,
    [num_product] [int] NULL ,
    [counter] [int] NULL ,
    [max_online] [int] NULL ,
    [max_tim] [datetime] NULL ,
    [start_tim] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [num_new] [int] NULL ,
    [today_tim] [smalldatetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[down] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
    [sizes] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [genre] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [os] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
    [power] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [emoney] [int] NULL ,
    [url] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [url2] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [pic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [homepage] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [counter] [int] NULL ,
    [keyes] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [types] [int] NULL ,
    [hidden] [bit] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[down_code] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [username] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [code] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[gallery] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [types] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [power] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [emoney] [int] NULL ,
    [spic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [pic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [hidden] [bit] NULL ,
    [istop] [int] NULL ,
    [counter] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[gb_data] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [nname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [sex] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [whe] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [qq] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
    [email] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [ip] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
    [sys] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [icon] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [face] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [re_icon] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [re_word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [re_tim] [datetime] NULL ,
    [hidden] [bit] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[jk_class] (
    [c_id] [int] IDENTITY (1, 1) NOT NULL ,
    [nsort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [c_name] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
    [c_order] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[jk_group] (
    [g_id] [int] IDENTITY (1, 1) NOT NULL ,
    [g_sort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [g_name] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[jk_sort] (
    [s_id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_name] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
    [s_order] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[links] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [orders] [int] NULL ,
    [sort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [nname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [pic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [hidden] [bit] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[news] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
    [comto] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [ispic] [bit] NULL ,
    [pic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [counter] [int] NULL ,
    [keyes] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [istop] [bit] NULL ,
    [hidden] [bit] NULL ,
    [cod] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[notes] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [nsort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [iid] [int] NULL ,
    [emoney] [int] NULL ,
    [tim] [datetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[notes_emoney] (
    [e_id] [int] IDENTITY (1, 1) NOT NULL ,
    [e_ordernum] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [e_username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [e_amount] [money] NULL ,
    [e_emoney] [int] NULL ,
    [e_tim] [datetime] NULL ,
    [e_ispay] [bit] NULL ,
    [e_ptim] [datetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[review] (
    [rid] [int] IDENTITY (1, 1) NOT NULL ,
    [rsort] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [re_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [rusername] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [remail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [rword] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [rtim] [datetime] NULL ,
    [rtype] [smallint] NULL ,
    [reword] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [retim] [datetime] NULL ,
    [rip] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[shop_cast] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [topic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [cod] [int] NULL ,
    [istop] [int] NULL ,
    [hidden] [bit] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[shop_emoney_notes] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [ordernum] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [pid] [int] NULL ,
    [serial] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [emoney] [int] NULL ,
    [num] [int] NULL ,
    [emoneys] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [nname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [address] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [code] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NULL ,
    [phone] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [email] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [types] [int] NULL ,
    [dis_tim] [datetime] NULL ,
    [dis_remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [carry] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [carry_price] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[shop_oorders] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [oid] [int] NULL ,
    [pid] [int] NULL ,
    [serial] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [price] [money] NULL ,
    [discount] [int] NULL ,
    [num] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[shop_orders] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [isuser] [bit] NULL ,
    [ordernum] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [nname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [address] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [code] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NULL ,
    [phone] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [email] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [payment] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [types] [int] NULL ,
    [dis_tim] [datetime] NULL ,
    [dis_remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [prices] [money] NULL ,
    [carry] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [carry_price] [int] NULL ,
    [ispayment] [bit] NULL ,
    [ispay] [bit] NULL ,
    [pay_tim] [datetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[shop_product] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [serial] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [brand] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [stock] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [down_url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [down_remark] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark_1] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark_2] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [price_1] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [price_2] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [smallimg] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [bigimg] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [counter] [int] NULL ,
    [buy_counter] [int] NULL ,
    [hidden] [bit] NULL ,
    [isgood] [bit] NULL ,
    [tim] [datetime] NULL ,
    [cod] [int] NULL ,
    [keyes] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [price] [money] NULL ,
    [discount] [int] NULL ,
    [is_emoney] [bit] NULL ,
    [emoney] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[upload] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [iid] [int] NULL ,
    [nsort] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [types] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [genre] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
    [sizes] [int] NULL ,
    [tim] [datetime] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[user_bookmark] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [g_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[user_data] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [nname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [password] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [passwd] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [sex] [bit] NULL ,
    [birthday] [datetime] NULL ,
    [whe] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [qq] [int] NULL ,
    [email] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [msn] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [phone] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [address] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [face] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [face_w] [int] NULL ,
    [face_h] [int] NULL ,
    [tim] [datetime] NULL ,
    [power] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [hidden] [bit] NULL ,
    [bbs_counter] [int] NULL ,
    [counter] [int] NULL ,
    [integral] [int] NULL ,
    [emoney] [int] NULL ,
    [login_num] [int] NULL ,
    [last_tim] [datetime] NULL ,
    [popedom] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [estate] [int] NULL ,
    [abate] [bit] NULL ,
    [otim] [smalldatetime] NULL ,
    [tmp] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[user_friend] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [username1] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [username2] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [types] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[user_login] (
    [l_id] [int] IDENTITY (1, 1) NOT NULL ,
    [l_username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [l_type] [bit] NULL ,
    [l_where] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [l_tim_login] [datetime] NULL ,
    [l_tim_end] [datetime] NULL ,
    [l_ip] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
    [l_sys] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[user_mail] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [send_u] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [accept_u] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [topic] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [word] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [types] [int] NULL ,
    [isread] [bit] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[vote] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [vid] [int] NULL ,
    [vtype] [int] NULL ,
    [vname] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [counter] [int] NULL
) ON [PRIMARY]
GO

Create TABLE [dbo].[vouch] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [sort] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
    [counter] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Create TABLE [dbo].[website] (
    [id] [int] IDENTITY (1, 1) NOT NULL ,
    [c_id] [int] NULL ,
    [s_id] [int] NULL ,
    [username] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
    [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [pic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [country] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [lang] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [remark] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
    [tim] [datetime] NULL ,
    [counter] [int] NULL ,
    [isgood] [bit] NULL ,
    [hidden] [bit] NULL
) ON [PRIMARY]
GO

Alter TABLE [dbo].[admin_event] WITH NOCHECK ADD
    CONSTRAINT [PK_admin_event] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[admin_menu] WITH NOCHECK ADD
    CONSTRAINT [PK_admin_menu] PRIMARY KEY  CLUSTERED
    (
        [m_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[ads] WITH NOCHECK ADD
    CONSTRAINT [PK_ads] PRIMARY KEY  CLUSTERED
    (
        [aid]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[ads_txt] WITH NOCHECK ADD
    CONSTRAINT [PK_ads_txt] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[article] WITH NOCHECK ADD
    CONSTRAINT [PK_article] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_cast] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_cast] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_class] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_class] PRIMARY KEY  CLUSTERED
    (
        [class_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_data] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_data] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_forum] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_forum] PRIMARY KEY  CLUSTERED
    (
        [forum_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_topic] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_topic] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[bbs_vote] WITH NOCHECK ADD
    CONSTRAINT [PK_bbs_vote] PRIMARY KEY  CLUSTERED
    (
        [v_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[cards] WITH NOCHECK ADD
    CONSTRAINT [PK_cards] PRIMARY KEY  CLUSTERED
    (
        [c_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[down] WITH NOCHECK ADD
    CONSTRAINT [PK_down] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[down_code] WITH NOCHECK ADD
    CONSTRAINT [PK_down_code] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[gallery] WITH NOCHECK ADD
    CONSTRAINT [PK_gallery] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[gb_data] WITH NOCHECK ADD
    CONSTRAINT [PK_gb_data] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[jk_class] WITH NOCHECK ADD
    CONSTRAINT [PK_jk_class] PRIMARY KEY  CLUSTERED
    (
        [c_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[jk_group] WITH NOCHECK ADD
    CONSTRAINT [PK_jk_group] PRIMARY KEY  CLUSTERED
    (
        [g_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[jk_sort] WITH NOCHECK ADD
    CONSTRAINT [PK_jk_sort] PRIMARY KEY  CLUSTERED
    (
        [s_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[links] WITH NOCHECK ADD
    CONSTRAINT [PK_links] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[news] WITH NOCHECK ADD
    CONSTRAINT [PK_news] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[notes] WITH NOCHECK ADD
    CONSTRAINT [PK_notes] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[notes_emoney] WITH NOCHECK ADD
    CONSTRAINT [PK_notes_emoney] PRIMARY KEY  CLUSTERED
    (
        [e_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[review] WITH NOCHECK ADD
    CONSTRAINT [PK_review] PRIMARY KEY  CLUSTERED
    (
        [rid]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[shop_cast] WITH NOCHECK ADD
    CONSTRAINT [PK_shop_cast] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[shop_emoney_notes] WITH NOCHECK ADD
    CONSTRAINT [PK_shop_emoney_notes] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[shop_oorders] WITH NOCHECK ADD
    CONSTRAINT [PK_oorder] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[shop_orders] WITH NOCHECK ADD
    CONSTRAINT [PK_orders] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[shop_product] WITH NOCHECK ADD
    CONSTRAINT [PK_product] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[upload] WITH NOCHECK ADD
    CONSTRAINT [PK_sys_upload] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[user_bookmark] WITH NOCHECK ADD
    CONSTRAINT [PK_user_bookmark] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[user_data] WITH NOCHECK ADD
    CONSTRAINT [PK_user_data] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[user_friend] WITH NOCHECK ADD
    CONSTRAINT [PK_user_friend] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[user_login] WITH NOCHECK ADD
    CONSTRAINT [PK_user_login] PRIMARY KEY  CLUSTERED
    (
        [l_id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[user_mail] WITH NOCHECK ADD
    CONSTRAINT [PK_user_mail] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[vote] WITH NOCHECK ADD
    CONSTRAINT [PK_vote] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[vouch] WITH NOCHECK ADD
    CONSTRAINT [PK_vouch] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

Alter TABLE [dbo].[website] WITH NOCHECK ADD
    CONSTRAINT [PK_website] PRIMARY KEY  CLUSTERED
    (
        [id]
    )  ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO


create procedure joekoe_forum_fir
@forumid int
AS
select top 1 forum_id,class_id,forum_f,forum_n,forum_w,forum_star,forum_parent,forum_name,forum_power,forum_type,forum_pro,forum_topic_num,forum_data_num from bbs_forum where forum_id=@forumid and forum_hidden=0

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO


create procedure joekoe_forum_list_main
@forumid int
AS
select forum_id,forum_n,forum_w,forum_name,forum_type,forum_pro,forum_new_info,forum_new_num,forum_topic_num,forum_data_num,forum_power,forum_remark,forum_pic from bbs_forum where forum_f=@forumid and forum_hidden=0 order by forum_order,forum_id

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO


create procedure joekoe_forum_main
AS
select forum_id,forum_n,forum_w,forum_name,forum_type,forum_pro,forum_new_info,forum_new_num,forum_topic_num,forum_data_num,forum_power,forum_remark,forum_pic,class_id from bbs_forum where forum_hidden=0 and forum_star<2 order by class_id,forum_order,forum_star

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO


create procedure joekoe_forum_view
@viewid int
AS
select bbs_data.id,bbs_data.topic,bbs_data.icon,bbs_data.word,bbs_data.tim,bbs_data.ip,bbs_data.sys,user_data.username,user_data.nname,user_data.sex,user_data.whe,user_data.qq,user_data.email,user_data.url,user_data.face,user_data.face_w,user_data.face_h,user_data.tim as u_tim,user_data.remark,user_data.emoney,user_data.integral,user_data.power,user_data.last_tim,user_data.bbs_counter,user_data.popedom from user_data,bbs_data where user_data.id=bbs_data.userid and bbs_data.reply_id=@viewid order by bbs_data.id

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

insert into [dbo].[user_data](username,password,passwd,sex,birthday,email,msn,phone,address,face,face_w,face_h,tim,power,hidden,bbs_counter,counter,integral,emoney,login_num,last_tim,popedom,estate,abate,otim,tmp)
        values('joekoe','dd15f89d35c36afb','dd15f89d35c36afb',1,'1980-6-16','joekoe@etang.com','','','','images/face/0.gif',90,90,getdate(),'admin',1,0,0,0,0,0,getdate(),'00000000000000000000000000000000000000000000000000',0,0,getdate(),'')

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 619
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭