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

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

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[chengyu] (
	[ChengYu] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[PingYin] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[DianGu] [nvarchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[ChuChu] [nvarchar] (180) COLLATE Chinese_PRC_CI_AS NULL ,
	[LiZi] [nvarchar] (120) COLLATE Chinese_PRC_CI_AS NULL ,
	[SPingYin] [nvarchar] (4) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[city] (
	[PROVINCE] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[DC] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[YZBM] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NULL ,
	[DHQH] [nvarchar] (5) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ip] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[qship] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[qsh1] [smallint] NULL ,
	[qsh2] [smallint] NULL ,
	[qsh3] [smallint] NULL ,
	[qsh4] [smallint] NULL ,
	[zhzhip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[quyu] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mod] (
	[start] [int] IDENTITY (1, 1) NOT NULL ,
	[end] [int] NULL ,
	[city] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[city1] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[url] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[grade] [int] NULL ,
	[thank] [nvarchar] (18) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[phone] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[haomaa] [int] NULL ,
	[haomab] [int] NULL ,
	[area] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[type] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[phone2] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[haoma] [int] NULL ,
	[province] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[area] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[pro_en] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[area_en] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[area_code] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sfz] (
	[BM] [int] IDENTITY (1, 1) NOT NULL ,
	[DQ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sinfo] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[stationno] [int] NULL ,
	[checi] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[arrtime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[starttime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[distance] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[costtime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[sinfo2] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[checi] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[startstation] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[tostation] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[distance] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[costtime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[zip] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[address] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[zip] [int] NULL ,
	[city] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[province] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ip] WITH NOCHECK ADD 
	CONSTRAINT [PK_ip] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mod] WITH NOCHECK ADD 
	CONSTRAINT [PK_mod] PRIMARY KEY  CLUSTERED 
	(
		[start]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[phone] WITH NOCHECK ADD 
	CONSTRAINT [PK_phone] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[phone2] WITH NOCHECK ADD 
	CONSTRAINT [PK_phone2] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sfz] WITH NOCHECK ADD 
	CONSTRAINT [PK_sfz] PRIMARY KEY  CLUSTERED 
	(
		[BM]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sinfo] WITH NOCHECK ADD 
	CONSTRAINT [PK_sinfo] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[sinfo2] WITH NOCHECK ADD 
	CONSTRAINT [PK_sinfo2] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[zip] WITH NOCHECK ADD 
	CONSTRAINT [PK_zip] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

