IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_config]') AND type in (N'U')) Drop Table [dbo].[sd_config]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_admin]') AND type in (N'U')) Drop Table [dbo].[sd_admin]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_admin_group]') AND type in (N'U')) Drop Table [dbo].[sd_admin_group]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_admin_menu]') AND type in (N'U')) Drop Table [dbo].[sd_admin_menu]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_attachment]') AND type in (N'U')) Drop Table [dbo].[sd_attachment]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_category]') AND type in (N'U')) Drop Table [dbo].[sd_category]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_content]') AND type in (N'U')) Drop Table [dbo].[sd_content]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_ad]') AND type in (N'U')) Drop Table [dbo].[sd_expand_ad]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_book]') AND type in (N'U')) Drop Table [dbo].[sd_expand_book]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_class]') AND type in (N'U')) Drop Table [dbo].[sd_expand_class]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_comment]') AND type in (N'U')) Drop Table [dbo].[sd_expand_comment]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_keyword]') AND type in (N'U')) Drop Table [dbo].[sd_expand_keyword]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_link]') AND type in (N'U')) Drop Table [dbo].[sd_expand_link]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_mood]') AND type in (N'U')) Drop Table [dbo].[sd_expand_mood]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_siteLink]') AND type in (N'U')) Drop Table [dbo].[sd_expand_siteLink]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_tags]') AND type in (N'U')) Drop Table [dbo].[sd_expand_tags]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_expand_vote]') AND type in (N'U')) Drop Table [dbo].[sd_expand_vote]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model]') AND type in (N'U')) Drop Table [dbo].[sd_model]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model_news]') AND type in (N'U')) Drop Table [dbo].[sd_model_news]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model_page]') AND type in (N'U')) Drop Table [dbo].[sd_model_page]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model_down]') AND type in (N'U')) Drop Table [dbo].[sd_model_down]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model_photo]') AND type in (N'U')) Drop Table [dbo].[sd_model_photo]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_model_video]') AND type in (N'U')) Drop Table [dbo].[sd_model_video]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user]') AND type in (N'U')) Drop Table [dbo].[sd_user]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_bind]') AND type in (N'U')) Drop Table [dbo].[sd_user_bind]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_buy]') AND type in (N'U')) Drop Table [dbo].[sd_user_buy]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_data]') AND type in (N'U')) Drop Table [dbo].[sd_user_data]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_favorite]') AND type in (N'U')) Drop Table [dbo].[sd_user_favorite]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_group]') AND type in (N'U')) Drop Table [dbo].[sd_user_group]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_message]') AND type in (N'U')) Drop Table [dbo].[sd_user_message]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_money]') AND type in (N'U')) Drop Table [dbo].[sd_user_money]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_payrecord]') AND type in (N'U')) Drop Table [dbo].[sd_user_payrecord]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_point]') AND type in (N'U')) Drop Table [dbo].[sd_user_point]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[view_category]') AND type in (N'U')) Drop View [dbo].[view_category]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_cart]') AND type in (N'U')) Drop Table [dbo].[sd_user_cart]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_address]') AND type in (N'U')) Drop Table [dbo].[sd_user_address]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_order]') AND type in (N'U')) Drop Table [dbo].[sd_user_order]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_order_item]') AND type in (N'U')) Drop Table [dbo].[sd_user_order_item]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_order_pay]') AND type in (N'U')) Drop Table [dbo].[sd_user_order_pay]
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[sd_user_order_post]') AND type in (N'U')) Drop Table [dbo].[sd_user_order_post]
CREATE TABLE [dbo].[sd_config]([setname] [nvarchar](50) NULL,[setkey] [nvarchar](50) NULL,[setvalue] [ntext] NULL)
CREATE TABLE [dbo].[sd_admin]([adminid] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[adminname] [nvarchar](20) NULL,[adminpass] [nvarchar](20) NULL,[penname] nvarchar(50) NULL,[groupid] [int] NULL,[logintimes] [int] NULL,[islock] [int] NULL,[lastlogindate] [datetime] NULL,[lastloginip] [nvarchar](15) NULL,[openid] [nvarchar](255) NULL)
CREATE TABLE [dbo].[sd_admin_group]([id] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[groupname] [nvarchar](50) NULL,[groupdesc] [nvarchar](50) NULL,[pagelever] [ntext] NULL,[catearray] [ntext] NULL,[catelever] [ntext] NULL,[createdate] [datetime] NULL)
CREATE TABLE [dbo].[sd_admin_menu]([id] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[title] [nvarchar](50) NULL,[url] [nvarchar](255) NULL,[followid] [int] NULL,[menuid] [int] NULL,[ordnum] [int] NULL,[islock] [int] NULL)
CREATE TABLE [dbo].[sd_attachment]([id] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[cid] [int] NULL,[classid] [int] NULL,[fullname] [nvarchar](255) NULL,[filepath] [nvarchar](255) NULL,[filename] [nvarchar](255) NULL,[filesize] [nvarchar](255) NULL,[oldname] [nvarchar](255) NULL,[fileext] [nvarchar](50) NULL,[ispic] [int] NULL,[createip] [nvarchar](50) NULL,[createdate] [datetime] NULL,[adminid] [int] NULL,[userid] [int] NULL)
CREATE TABLE [dbo].[sd_category]([cateid] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[catename] [nvarchar](50) NULL,[catedir] [nvarchar](255) NULL,[followid] [int] NULL,[depth] [int] NULL,[sonid] [ntext] NULL,[parentid] [ntext] NULL,[ordnum] [int] NULL,[ismenu] [int] NULL,[catepic] [nvarchar](255) NULL,[seotitle] [nvarchar](255) NULL,[catekey] [nvarchar](255) NULL,[catedesc] [ntext] NULL,[cateurl] [nvarchar](255) NULL,[modeid] [int] NULL,[pagenum] [int] NULL,[cate_list] [nvarchar](255) NULL,[cate_show] [nvarchar](255) NULL,[domain] [nvarchar](255) NULL,[urlrule] [nvarchar](50) NULL,[allowpost] [int] NULL)
CREATE TABLE [dbo].[sd_content]([id] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,[classid] [int] NULL,[title] [nvarchar](255) NULL,[createdate] [datetime] NULL,[lastupdate] [datetime] NULL,[author] [nvarchar](50) NULL,[comefrom] [nvarchar](50) NULL,[hits] [int] NULL,[style] [nvarchar](255) NULL,[pic] [nvarchar](255) NULL,[ispic] [int] NULL,[tags] [nvarchar](