正式运用省市
use fqdb
//这两句与省市无关 用语句向数据库表里添加字段
alter table HQFS_ORDER add ProvinceName varchar(50)
alter table HQFS_ORDER add CityName varchar(50)
USE [fqdb]
GO
/****** Object: Table [dbo].[Base_Province] Script Date: 09/26/2011 12:38:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Base_Province123](
[Id] [int] IDENTITY(1,1) NOT NULL,
[ParentId] [int] NOT NULL,
[PName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[PCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
CONSTRAINT [PK_Base_Province123] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
--创建省市(省表)
insert into Base_Province(ParentId,PName,PCode)values(1,'北京市','001')
insert into Base_Province(ParentId,PName,PCode)values(2,'天津市','002')
insert into Base_Province(ParentId,PName,PCode)values(3,'上海市','003')
insert into Base_Province(ParentId,PName,PCode)values(4,'重庆市','004')
insert into Base_Province(ParentId,PName,PCode)values(5,'河北省','005')
insert into Base_Province(ParentId,PName,PCode)values(6,'山西省','006')
insert into Base_Province(ParentId,PName,PCode)values(7,'台湾省','007')
insert into Base_Province(ParentId,PName,PCode)values(8,'辽宁省','008')
insert into Base_Province(ParentId,PName,PCode)values(9,'吉林省','009')
insert into Base_Province(ParentId,PName,PCode)values(10,'黑龙江省','010')
insert into Base_Province(ParentId,PName,PCode)values(11,'江苏省','011')
insert into Base_Province(ParentId,PName,PCode)values(12,'浙江省','012')
insert into Base_Province(ParentId,PName,PCode)values(13,'安徽省','013')
insert into Base_Province(ParentId,PName,PCode)values(14,'福建省','014')
insert into Base_Province(ParentId,PName,PCode)values(15,'江西省','015')
insert into Base_Province(ParentId,PName,PCode)values(16,'山东省','016')
insert into Base_Province(ParentId,PName,PCode)values(17,'河南省','017')
insert into Base_Province(ParentId,PName,PCode)values(18,'湖北省','018')
insert into Base_Province(ParentId,PName,PCode)values(19,'湖南省','019')
insert into Base_Province(ParentId,PName,PCode)values(20,'广东省','020')
insert into Base_Province(ParentId,PName,PCode)values(21,'甘肃省','021')
insert into Base_Province(ParentId,PName,PCode)values(22,'四川省','022')
insert into Base_Province(ParentId,PName,PCode)values(23,'贵州省','023')
insert into Base_Province(ParentId,PName,PCode)values(24,'海南省','024')
insert into Base_Province(ParentId,PName,PCode)values(25,'云南省','025')
insert into Base_Province(ParentId,PName,PCode)values(26,'青海省','026')
insert into Base_Province(ParentId,PName,PCode)values(27,'陕西省','027')
insert into Base_Province(ParentId,PName,PCode)values(28,'广西壮族自治区','028')
insert into Base_Province(ParentId,PName,PCode)values(29,'西藏自治区','029')
insert into Base_Province(ParentId,PName,PCode)values(30,'宁夏回族自治区','030')
insert into Base_Province(ParentId,PName,PCode)values(31,'新疆维吾尔自治区','031')
insert into Base_Province(ParentId,PName,PCode)values(32,'内蒙古自治区','032')
insert into Base_Province(ParentId,PName,PCode)values(33,'澳门特别行政区','033')
insert into Base_Province(ParentId,PName,PCode)values(34,'香港特别行政区','034')
--插入各个省的城市数据--4个直辖市
insert into Base_Province(ParentId,PName,PCode) values(1,'北京市','001001')
insert into Base_Province(ParentId,PName,PCode) values(2,'天津市','002001')
insert into Base_Province(ParentId,PName,PCode) values(3,'上海市','003001')
insert into Base_Province(ParentId,PName,PCode) values(4,'重庆市','004001')
--5河北省(2005年辖:个地级市,个市辖区、个县级市、个县、个自治县)
insert into Base_Province(ParentId,PName,PCode) values(5,'石家庄市','005001')
insert into Base_Province(ParentId,PName,PCode) values(5,'唐山市','005002')
insert into Base_Province(ParentId,PName,PCode) values(5,'秦皇岛市','005003')
insert into Base_Province(ParentId,PName,PCode) values(5,'邯郸市','005004')
insert into Base_Province(ParentId,PName,PCode) values(5,'邢台市','005005')
insert into Base_Province(ParentId,PName,PCode) values(5,'保定市','005006')
insert into Base_Province(ParentId,PName,PCode) values(5,'张家口市','005007')
insert into Base_Province(ParentId,PName,PCode) values(5,'承德市','005008')
insert into Base_Province(ParentId,PName,PCode) values(5,'沧州市','005009')
insert into Base_Province(ParentId,PName,PCode) values(5,'廊坊市','005010')
insert into Base_Province(ParentId,PName,PCode) values(5,'衡水市','005011')
--6山西省个城市
insert into Base_Province(ParentId,PName,PCode) values(6,'太原市','006001')
insert into Base_Province(ParentId,PName,PCode) values(6,'大同市','006002')
insert into Base_Province(ParentId,PName,PCode) values(6,'阳泉市','006003')
insert into Base_Province(ParentId,PName,PCode) values(6,'长治市','006004')
insert into Base_Province(ParentId,PName,PCode) values(6,'晋城市','006005')
insert into Base_Province(ParentId,PName,PCode) values(6,'朔州市','006006')
insert into Base_Province(ParentId,PName,PCode) values(6,'晋中市','006007')
insert into Base_Province(ParentId,PName,PCode) values(6,'运城市','006008')
insert into Base_Province(ParentId,PName,PCode) values(6,'忻州市','006009')
insert into Base_Province(ParentId,PName,PCode) values(6,'临汾市','006010')
insert into Base_Province(ParentId,PName,PCode) values(6,'吕梁市','006011')
--7台湾省(台湾本岛和澎湖共设市、县,其中台北市和高雄市为“院辖市”,直属“行政院”,其余属台湾省;市下设区,县下设市(县辖市)、镇、乡,合称区市镇乡。)
insert into Base_Province(PCode,PName,ParentId) values('007001','台北市',7)
insert into Base_Province(PCode,PName,ParentId) values('007002','高雄市',7)
insert into Base_Province(PCode,PName,ParentId) values('007003','基隆市',7)
insert into Base_Province(PCode,PName,ParentId) values('007004','台中市',7)
insert into Base_Province(PCode,PName,ParentId) values('007005','台南市',7)
insert into Base_Province(PCode,PName,ParentId) values('007006','新竹市',7)
insert into Base_Province(PCode,PName,ParentId) values('007007','嘉义市',7)
insert into Base_Province(PCode,PName,ParentId) values('007008','台北县',7)
insert into Base_Province(PCode,PName,ParentId) values('007009','宜兰县',7)
insert into Base_Province(PCode,PName,ParentId) values('007010','桃园县',7)
insert into Base_Province(PCode,PName,ParentId) values('007011','新竹县',7)
insert into Base_Province(PCode,PName,ParentId) values('007012','苗栗县',7)
insert into Base_Province(PCode,PName,ParentId) values('007013','台中县',7)
insert into Base_Province(PCode,PName,ParentId) values('007014','彰化县',7)
insert into Base_Province(PCode,PName,ParentId) values('007015','南投县',7)
insert into Base_Province(PCode,PName,ParentId) values('007016','云林县',7)
insert into Base_Province(PCode,PName,ParentId) values('007017','嘉义县',7)
insert into Base_Province(PCode,PName,ParentId) values('007018','台南县',7)
insert into Base_Province(PCode,PName,ParentId) values('007019','高雄县',7)
insert into Base_Province(PCode,PName,ParentId) values('007020','屏东县',7)
insert into Base_Province(PCode,PName,ParentId) values('007021','澎湖县',7)
insert into Base_Province(PCode,PName,ParentId) values('007022','台东县',7)
insert into Base_Province(PCode,PName,ParentId) values('007023','花莲县',7)
--8辽宁省(2006年,辖:个地级市;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('008001','沈阳市',8)
insert into Base_Province(PCode,PName,ParentId) values('008002','大连市',8)
insert into Base_Province(PCode,PName,ParentId) values('008003','鞍山市',8)
insert into Base_Province(PCode,PName,ParentId) values('008004','抚顺市',8)
insert into Base_Province(PCode,PName,ParentId) values('008005','本溪市',8)
insert into Base_Province(PCode,PName,ParentId) values('008006','丹东市',8)
insert into Base_Province(PCode,PName,ParentId) values('008007','锦州市',8)
insert into Base_Province(PCode,PName,ParentId) values('008008','营口市',8)
insert into Base_Province(PCode,PName,ParentId) values('008009','阜新市',8)
insert into Base_Province(PCode,PName,ParentId) values('008010','辽阳市',8)
insert into Base_Province(PCode,PName,ParentId) values('008011','盘锦市',8)
insert into Base_Province(PCode,PName,ParentId) values('008012','铁岭市',8)
insert into Base_Province(PCode,PName,ParentId) values('008013','朝阳市',8)
insert into Base_Province(PCode,PName,ParentId) values('008014','葫芦岛市',8)
--9吉林省(2006年,辖:个地级市、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('009001','长春市',9)
insert into Base_Province(PCode,PName,ParentId) values('009002','吉林市',9)
insert into Base_Province(PCode,PName,ParentId) values('009003','四平市',9)
insert into Base_Province(PCode,PName,ParentId) values('009004','辽源市',9)
insert into Base_Province(PCode,PName,ParentId) values('009005','通化市',9)
insert into Base_Province(PCode,PName,ParentId) values('009006','白山市',9)
insert into Base_Province(PCode,PName,ParentId) values('009007','松原市',9)
insert into Base_Province(PCode,PName,ParentId) values('009008','白城市',9)
insert into Base_Province(PCode,PName,ParentId) values('009009','延边朝鲜族自治州',9)
--10黑龙江省(2006年,辖:地级市、地区;市辖区、县级市、县、自治县)
insert into Base_Province(PCode,PName,ParentId) values('010001','哈尔滨市',10)
insert into Base_Province(PCode,PName,ParentId) values('010002','齐齐哈尔市',10)
insert into Base_Province(PCode,PName,ParentId) values('010003','鹤岗市',10)
insert into Base_Province(PCode,PName,ParentId) values('010004','双鸭山市',10)
insert into Base_Province(PCode,PName,ParentId) values('010005','鸡西市',10)
insert into Base_Province(PCode,PName,ParentId) values('010006','大庆市',10)
insert into Base_Province(PCode,PName,ParentId) values('010007','伊春市',10)
insert into Base_Province(PCode,PName,ParentId) values('010008','牡丹江市',10)
insert into Base_Province(PCode,PName,ParentId) values('010009','佳木斯市',10)
insert into Base_Province(PCode,PName,ParentId) values('010010','七台河市',10)
insert into Base_Province(PCode,PName,ParentId) values('010011','黑河市',10)
insert into Base_Province(PCode,PName,ParentId) values('010012','绥化市',10)
insert into Base_Province(PCode,PName,ParentId) values('010013','大兴安岭地区',10)
--11江苏省(2005年辖:个地级市;个市辖区、个县级市、个县)
insert into Base_Province(PCode,PName,ParentId) values('011001','南京市',11)
insert into Base_Province(PCode,PName,ParentId) values('011002','无锡市',11)
insert into Base_Province(PCode,PName,ParentId) values('011003','徐州市',11)
insert into Base_Province(PCode,PName,ParentId) values('011004','常州市',11)
insert into Base_Province(PCode,PName,ParentId) values('011005','苏州市',11)
insert into Base_Province(PCode,PName,ParentId) values('011006','南通市',11)
insert into Base_Province(PCode,PName,ParentId) values('011007','连云港市',11)
insert into Base_Province(PCode,PName,ParentId) values('011008','淮安市',11)
insert into Base_Province(PCode,PName,ParentId) values('011009','盐城市',11)
insert into Base_Province(PCode,PName,ParentId) values('011010','扬州市',11)
insert into Base_Province(PCode,PName,ParentId) values('011011','镇江市',11)
insert into Base_Province(PCode,PName,ParentId) values('011012','泰州市',11)
insert into Base_Province(PCode,PName,ParentId) values('011013','宿迁市',11)
--12浙江省(2006年,辖:个地级市;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('012001','杭州市',12)
insert into Base_Province(PCode,PName,ParentId) values('012002','宁波市',12)
insert into Base_Province(PCode,PName,ParentId) values('012003','温州市',12)
insert into Base_Province(PCode,PName,ParentId) values('012004','嘉兴市',12)
insert into Base_Province(PCode,PName,ParentId) values('012005','湖州市',12)
insert into Base_Province(PCode,PName,ParentId) values('012006','绍兴市',12)
insert into Base_Province(PCode,PName,ParentId) values('012007','金华市',12)
insert into Base_Province(PCode,PName,ParentId) values('012008','衢州市',12)
insert into Base_Province(PCode,PName,ParentId) values('012009','舟山市',12)
insert into Base_Province(PCode,PName,ParentId) values('012010','台州市',12)
insert into Base_Province(PCode,PName,ParentId) values('012011','丽水市',12)
--13安徽省(2005年辖:个地级市;个市辖区、县个级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('013001','合肥市',13)
insert into Base_Province(PCode,PName,ParentId) values('013002','芜湖市',13)
insert into Base_Province(PCode,PName,ParentId) values('013003','蚌埠市',13)
insert into Base_Province(PCode,PName,ParentId) values('013004','淮南市',13)
insert into Base_Province(PCode,PName,ParentId) values('013005','马鞍山市',13)
insert into Base_Province(PCode,PName,ParentId) values('013006','淮北市',13)
insert into Base_Province(PCode,PName,ParentId) values('013007','铜陵市',13)
insert into Base_Province(PCode,PName,ParentId) values('013008','安庆市',13)
insert into Base_Province(PCode,PName,ParentId) values('013009','黄山市',13)
insert into Base_Province(PCode,PName,ParentId) values('013010','滁州市',13)
insert into Base_Province(PCode,PName,ParentId) values('013011','阜阳市',13)
insert into Base_Province(PCode,PName,ParentId) values('013012','宿州市',13)
insert into Base_Province(PCode,PName,ParentId) values('013013','巢湖市',13)
insert into Base_Province(PCode,PName,ParentId) values('013014','六安市',13)
insert into Base_Province(PCode,PName,ParentId) values('013015','亳州市',13)
insert into Base_Province(PCode,PName,ParentId) values('013016','池州市',13)
insert into Base_Province(PCode,PName,ParentId) values('013017','宣城市',13)
--14福建省(2006年辖:个地级市;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('014001','福州市',14)
insert into Base_Province(PCode,PName,ParentId) values('014002','厦门市',14)
insert into Base_Province(PCode,PName,ParentId) values('014003','莆田市',14)
insert into Base_Province(PCode,PName,ParentId) values('014004','三明市',14)
insert into Base_Province(PCode,PName,ParentId) values('014005','泉州市',14)
insert into Base_Province(PCode,PName,ParentId) values('014006','漳州市',14)
insert into Base_Province(PCode,PName,ParentId) values('014007','南平市',14)
insert into Base_Province(PCode,PName,ParentId) values('014008','龙岩市',14)
insert into Base_Province(PCode,PName,ParentId) values('014009','宁德市',14)
--15江西省(2006年全省辖:个地级市;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('015001','南昌市',15)
insert into Base_Province(PCode,PName,ParentId) values('015002','景德镇市',15)
insert into Base_Province(PCode,PName,ParentId) values('015003','萍乡市',15)
insert into Base_Province(PCode,PName,ParentId) values('015004','九江市',15)
insert into Base_Province(PCode,PName,ParentId) values('015005','新余市',15)
insert into Base_Province(PCode,PName,ParentId) values('015006','鹰潭市',15)
insert into Base_Province(PCode,PName,ParentId) values('015007','赣州市',15)
insert into Base_Province(PCode,PName,ParentId) values('015008','吉安市',15)
insert into Base_Province(PCode,PName,ParentId) values('015009','宜春市',15)
insert into Base_Province(PCode,PName,ParentId) values('015010','抚州市',15)
insert into Base_Province(PCode,PName,ParentId) values('015011','上饶市',15)
--16山东省(2005年,辖:个地级市;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('016001','济南市',16)
insert into Base_Province(PCode,PName,ParentId) values('016002','青岛市',16)
insert into Base_Province(PCode,PName,ParentId) values('016003','淄博市',16)
insert into Base_Province(PCode,PName,ParentId) values('016004','枣庄市',16)
insert into Base_Province(PCode,PName,ParentId) values('016005','东营市',16)
insert into Base_Province(PCode,PName,ParentId) values('016006','烟台市',16)
insert into Base_Province(PCode,PName,ParentId) values('016007','潍坊市',16)
insert into Base_Province(PCode,PName,ParentId) values('016008','济宁市',16)
insert into Base_Province(PCode,PName,ParentId) values('016009','泰安市',16)
insert into Base_Province(PCode,PName,ParentId) values('016010','威海市',16)
insert into Base_Province(PCode,PName,ParentId) values('016011','日照市',16)
insert into Base_Province(PCode,PName,ParentId) values('016012','莱芜市',16)
insert into Base_Province(PCode,PName,ParentId) values('016013','临沂市',16)
insert into Base_Province(PCode,PName,ParentId) values('016014','德州市',16)
insert into Base_Province(PCode,PName,ParentId) values('016015','聊城市',16)
insert into Base_Province(PCode,PName,ParentId) values('016016','滨州市',16)
insert into Base_Province(PCode,PName,ParentId) values('016017','菏泽市',16)
--17河南省(年辖:个地级市;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('017001','郑州市',17)
insert into Base_Province(PCode,PName,ParentId) values('017002','开封市',17)
insert into Base_Province(PCode,PName,ParentId) values('017003','洛阳市',17)
insert into Base_Province(PCode,PName,ParentId) values('017004','平顶山市',17)
insert into Base_Province(PCode,PName,ParentId) values('017005','安阳市',17)
insert into Base_Province(PCode,PName,ParentId) values('017006','鹤壁市',17)
insert into Base_Province(PCode,PName,ParentId) values('017007','新乡市',17)
insert into Base_Province(PCode,PName,ParentId) values('017008','焦作市',17)
insert into Base_Province(PCode,PName,ParentId) values('017009','濮阳市',17)
insert into Base_Province(PCode,PName,ParentId) values('017010','许昌市',17)
insert into Base_Province(PCode,PName,ParentId) values('017011','漯河市',17)
insert into Base_Province(PCode,PName,ParentId) values('017012','三门峡市',17)
insert into Base_Province(PCode,PName,ParentId) values('017013','南阳市',17)
insert into Base_Province(PCode,PName,ParentId) values('017014','商丘市',17)
insert into Base_Province(PCode,PName,ParentId) values('017015','信阳市',17)
insert into Base_Province(PCode,PName,ParentId) values('017016','周口市',17)
insert into Base_Province(PCode,PName,ParentId) values('017017','驻马店市',17)
insert into Base_Province(PCode,PName,ParentId) values('017018','济源市',17)
--18湖北省(截至年月日,全省辖个地级单位(个地级市、个自治州);县级单位(个市辖区、个县级市、个县、个自治县、个林区),共有个乡级单位(个街道、个镇、个乡)。)
insert into Base_Province(PCode,PName,ParentId) values('018001','武汉市',18)
insert into Base_Province(PCode,PName,ParentId) values('018002','黄石市',18)
insert into Base_Province(PCode,PName,ParentId) values('018003','十堰市',18)
insert into Base_Province(PCode,PName,ParentId) values('018004','荆州市',18)
insert into Base_Province(PCode,PName,ParentId) values('018005','宜昌市',18)
insert into Base_Province(PCode,PName,ParentId) values('018006','襄樊市',18)
insert into Base_Province(PCode,PName,ParentId) values('018007','鄂州市',18)
insert into Base_Province(PCode,PName,ParentId) values('018008','荆门市',18)
insert into Base_Province(PCode,PName,ParentId) values('018009','孝感市',18)
insert into Base_Province(PCode,PName,ParentId) values('018010','黄冈市',18)
insert into Base_Province(PCode,PName,ParentId) values('018011','咸宁市',18)
insert into Base_Province(PCode,PName,ParentId) values('018012','随州市',18)
insert into Base_Province(PCode,PName,ParentId) values('018013','仙桃市',18)
insert into Base_Province(PCode,PName,ParentId) values('018014','天门市',18)
insert into Base_Province(PCode,PName,ParentId) values('018015','潜江市',18)
insert into Base_Province(PCode,PName,ParentId) values('018016','神农架林区',18)
insert into Base_Province(PCode,PName,ParentId) values('018017','恩施土家族苗族自治州',18)
--19湖南省(年辖:个地级市、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('019001','长沙市',19)
insert into Base_Province(PCode,PName,ParentId) values('019002','株洲市',19)
insert into Base_Province(PCode,PName,ParentId) values('019003','湘潭市',19)
insert into Base_Province(PCode,PName,ParentId) values('019004','衡阳市',19)
insert into Base_Province(PCode,PName,ParentId) values('019005','邵阳市',19)
insert into Base_Province(PCode,PName,ParentId) values('019006','岳阳市',19)
insert into Base_Province(PCode,PName,ParentId) values('019007','常德市',19)
insert into Base_Province(PCode,PName,ParentId) values('019008','张家界市',19)
insert into Base_Province(PCode,PName,ParentId) values('019009','益阳市',19)
insert into Base_Province(PCode,PName,ParentId) values('019010','郴州市',19)
insert into Base_Province(PCode,PName,ParentId) values('019011','永州市',19)
insert into Base_Province(PCode,PName,ParentId) values('019012','怀化市',19)
insert into Base_Province(PCode,PName,ParentId) values('019013','娄底市',19)
insert into Base_Province(PCode,PName,ParentId) values('019014','湘西土家族苗族自治州',19)
--20广东省(截至年月日,广东省辖:个地级市,个市辖区、个县级市、个县、个自治县,个街道办事处、个镇、个乡、个民族乡。)
insert into Base_Province(PCode,PName,ParentId) values('020001','广州市',20)
insert into Base_Province(PCode,PName,ParentId) values('020002','深圳市',20)
insert into Base_Province(PCode,PName,ParentId) values('020003','珠海市',20)
insert into Base_Province(PCode,PName,ParentId) values('020004','汕头市',20)
insert into Base_Province(PCode,PName,ParentId) values('020005','韶关市',20)
insert into Base_Province(PCode,PName,ParentId) values('020006','佛山市',20)
insert into Base_Province(PCode,PName,ParentId) values('020007','江门市',20)
insert into Base_Province(PCode,PName,ParentId) values('020008','湛江市',20)
insert into Base_Province(PCode,PName,ParentId) values('020009','茂名市',20)
insert into Base_Province(PCode,PName,ParentId) values('020010','肇庆市',20)
insert into Base_Province(PCode,PName,ParentId) values('020011','惠州市',20)
insert into Base_Province(PCode,PName,ParentId) values('020012','梅州市',20)
insert into Base_Province(PCode,PName,ParentId) values('020013','汕尾市',20)
insert into Base_Province(PCode,PName,ParentId) values('020014','河源市',20)
insert into Base_Province(PCode,PName,ParentId) values('020015','阳江市',20)
insert into Base_Province(PCode,PName,ParentId) values('020016','清远市',20)
insert into Base_Province(PCode,PName,ParentId) values('020017','东莞市',20)
insert into Base_Province(PCode,PName,ParentId) values('020018','中山市',20)
insert into Base_Province(PCode,PName,ParentId) values('020019','潮州市',20)
insert into Base_Province(PCode,PName,ParentId) values('020020','揭阳市',20)
insert into Base_Province(PCode,PName,ParentId) values('020021','云浮市',20)
--21甘肃省(年辖:个地级市、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('021001','兰州市',21)
insert into Base_Province(PCode,PName,ParentId) values('021002','金昌市',21)
insert into Base_Province(PCode,PName,ParentId) values('021003','白银市',21)
insert into Base_Province(PCode,PName,ParentId) values('021004','天水市',21)
insert into Base_Province(PCode,PName,ParentId) values('021005','嘉峪关市',21)
insert into Base_Province(PCode,PName,ParentId) values('021006','武威市',21)
insert into Base_Province(PCode,PName,ParentId) values('021007','张掖市',21)
insert into Base_Province(PCode,PName,ParentId) values('021008','平凉市',21)
insert into Base_Province(PCode,PName,ParentId) values('021009','酒泉市',21)
insert into Base_Province(PCode,PName,ParentId) values('021010','庆阳市',21)
insert into Base_Province(PCode,PName,ParentId) values('021011','定西市',21)
insert into Base_Province(PCode,PName,ParentId) values('021012','陇南市',21)
insert into Base_Province(PCode,PName,ParentId) values('021013','临夏回族自治州',21)
insert into Base_Province(PCode,PName,ParentId) values('021014','甘南藏族自治州',21)
--22四川省(年辖:个地级市、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('022001','成都市',22)
insert into Base_Province(PCode,PName,ParentId) values('022002','自贡市',22)
insert into Base_Province(PCode,PName,ParentId) values('022003','攀枝花市',22)
insert into Base_Province(PCode,PName,ParentId) values('022004','泸州市',22)
insert into Base_Province(PCode,PName,ParentId) values('022005','德阳市',22)
insert into Base_Province(PCode,PName,ParentId) values('022006','绵阳市',22)
insert into Base_Province(PCode,PName,ParentId) values('022007','广元市',22)
insert into Base_Province(PCode,PName,ParentId) values('022008','遂宁市',22)
insert into Base_Province(PCode,PName,ParentId) values('022009','内江市',22)
insert into Base_Province(PCode,PName,ParentId) values('022010','乐山市',22)
insert into Base_Province(PCode,PName,ParentId) values('022011','南充市',22)
insert into Base_Province(PCode,PName,ParentId) values('022012','眉山市',22)
insert into Base_Province(PCode,PName,ParentId) values('022013','宜宾市',22)
insert into Base_Province(PCode,PName,ParentId) values('022014','广安市',22)
insert into Base_Province(PCode,PName,ParentId) values('022015','达州市',22)
insert into Base_Province(PCode,PName,ParentId) values('022016','雅安市',22)
insert into Base_Province(PCode,PName,ParentId) values('022017','巴中市',22)
insert into Base_Province(PCode,PName,ParentId) values('022018','资阳市',22)
insert into Base_Province(PCode,PName,ParentId) values('022019','阿坝藏族羌族自治州',22)
insert into Base_Province(PCode,PName,ParentId) values('022020','甘孜藏族自治州',22)
insert into Base_Province(PCode,PName,ParentId) values('022021','凉山彝族自治州',22)
--23贵州省(2006年辖:个地级市、个地区、个自治州;个市辖区、个县级市、个县、个自治县、个特区。)
insert into Base_Province(PCode,PName,ParentId) values('023001','贵阳市',23)
insert into Base_Province(PCode,PName,ParentId) values('023002','六盘水市',23)
insert into Base_Province(PCode,PName,ParentId) values('023003','遵义市',23)
insert into Base_Province(PCode,PName,ParentId) values('023004','安顺市',23)
insert into Base_Province(PCode,PName,ParentId) values('023005','铜仁地区',23)
insert into Base_Province(PCode,PName,ParentId) values('023006','毕节地区',23)
insert into Base_Province(PCode,PName,ParentId) values('023007','黔西南布依族苗族自治州',23)
insert into Base_Province(PCode,PName,ParentId) values('023008','黔东南苗族侗族自治州',23)
insert into Base_Province(PCode,PName,ParentId) values('023009','黔南布依族苗族自治州',23)
--24海南省(2003-年全省有个地级市,个县级市,个县,个民族自治县,个市辖区,个办事处(西南中沙群岛办事处,县级)。)
insert into Base_Province(PCode,PName,ParentId) values('024001','海口市',24)
insert into Base_Province(PCode,PName,ParentId) values('024002','三亚市',24)
insert into Base_Province(PCode,PName,ParentId) values('024003','五指山市',24)
insert into Base_Province(PCode,PName,ParentId) values('024004','琼海市',24)
insert into Base_Province(PCode,PName,ParentId) values('024005','儋州市',24)
insert into Base_Province(PCode,PName,ParentId) values('024006','文昌市',24)
insert into Base_Province(PCode,PName,ParentId) values('024007','万宁市',24)
insert into Base_Province(PCode,PName,ParentId) values('024008','东方市',24)
insert into Base_Province(PCode,PName,ParentId) values('024009','澄迈县',24)
insert into Base_Province(PCode,PName,ParentId) values('024010','定安县',24)
insert into Base_Province(PCode,PName,ParentId) values('024011','屯昌县',24)
insert into Base_Province(PCode,PName,ParentId) values('024012','临高县',24)
insert into Base_Province(PCode,PName,ParentId) values('024013','白沙黎族自治县',24)
insert into Base_Province(PCode,PName,ParentId) values('024014','昌江黎族自治县',24)
insert into Base_Province(PCode,PName,ParentId) values('024015','乐东黎族自治县',24)
insert into Base_Province(PCode,PName,ParentId) values('024016','陵水黎族自治县',24)
insert into Base_Province(PCode,PName,ParentId) values('024017','保亭黎族苗族自治县',24)
insert into Base_Province(PCode,PName,ParentId) values('024018','琼中黎族苗族自治县',24)
--25云南省(2006年辖:个地级市、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('025001','昆明市',25)
insert into Base_Province(PCode,PName,ParentId) values('025002','曲靖市',25)
insert into Base_Province(PCode,PName,ParentId) values('025003','玉溪市',25)
insert into Base_Province(PCode,PName,ParentId) values('025004','保山市',25)
insert into Base_Province(PCode,PName,ParentId) values('025005','昭通市',25)
insert into Base_Province(PCode,PName,ParentId) values('025006','丽江市',25)
insert into Base_Province(PCode,PName,ParentId) values('025007','思茅市',25)
insert into Base_Province(PCode,PName,ParentId) values('025008','临沧市',25)
insert into Base_Province(PCode,PName,ParentId) values('025009','文山壮族苗族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025010','红河哈尼族彝族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025011','西双版纳傣族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025012','楚雄彝族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025013','大理白族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025014','德宏傣族景颇族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025015','怒江傈傈族自治州',25)
insert into Base_Province(PCode,PName,ParentId) values('025016','迪庆藏族自治州',25)
--26青海省(2006年辖:个地级市、个地区、个自治州;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('026001','西宁市',26)
insert into Base_Province(PCode,PName,ParentId) values('026002','海东地区',26)
insert into Base_Province(PCode,PName,ParentId) values('026003','海北藏族自治州',26)
insert into Base_Province(PCode,PName,ParentId) values('026004','黄南藏族自治州',26)
insert into Base_Province(PCode,PName,ParentId) values('026005','海南藏族自治州',26)
insert into Base_Province(PCode,PName,ParentId) values('026006','果洛藏族自治州',26)
insert into Base_Province(PCode,PName,ParentId) values('026007','玉树藏族自治州',26)
insert into Base_Province(PCode,PName,ParentId) values('026008','海西蒙古族藏族自治州',26)
--27陕西省(2006年辖:个地级市;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('027001','西安市',27)
insert into Base_Province(PCode,PName,ParentId) values('027002','铜川市',27)
insert into Base_Province(PCode,PName,ParentId) values('027003','宝鸡市',27)
insert into Base_Province(PCode,PName,ParentId) values('027004','咸阳市',27)
insert into Base_Province(PCode,PName,ParentId) values('027005','渭南市',27)
insert into Base_Province(PCode,PName,ParentId) values('027006','延安市',27)
insert into Base_Province(PCode,PName,ParentId) values('027007','汉中市',27)
insert into Base_Province(PCode,PName,ParentId) values('027008','榆林市',27)
insert into Base_Province(PCode,PName,ParentId) values('027009','安康市',27)
insert into Base_Province(PCode,PName,ParentId) values('027010','商洛市',27)
--28广西壮族自治区(2005年辖:个地级市;个市辖区、个县级市、个县、个自治县。)
insert into Base_Province(PCode,PName,ParentId) values('028001','南宁市',28)
insert into Base_Province(PCode,PName,ParentId) values('028002','柳州市',28)
insert into Base_Province(PCode,PName,ParentId) values('028003','桂林市',28)
insert into Base_Province(PCode,PName,ParentId) values('028004','梧州市',28)
insert into Base_Province(PCode,PName,ParentId) values('028005','北海市',28)
insert into Base_Province(PCode,PName,ParentId) values('028006','防城港市',28)
insert into Base_Province(PCode,PName,ParentId) values('028007','钦州市',28)
insert into Base_Province(PCode,PName,ParentId) values('028008','贵港市',28)
insert into Base_Province(PCode,PName,ParentId) values('028009','玉林市',28)
insert into Base_Province(PCode,PName,ParentId) values('028010','百色市',28)
insert into Base_Province(PCode,PName,ParentId) values('028011','贺州市',28)
insert into Base_Province(PCode,PName,ParentId) values('028012','河池市',28)
insert into Base_Province(PCode,PName,ParentId) values('028013','来宾市',28)
insert into Base_Province(PCode,PName,ParentId) values('028014','崇左市',28)
--29西藏自治区(2005年辖:个地级市、个地区;个市辖区、个县级市、个县。)
insert into Base_Province(PCode,PName,ParentId) values('029001','拉萨市',29)
insert into Base_Province(PCode,PName,ParentId) values('029002','那曲地区',29)
insert into Base_Province(PCode,PName,ParentId) values('029003','昌都地区',29)
insert into Base_Province(PCode,PName,ParentId) values('029004','山南地区',29)
insert into Base_Province(PCode,PName,ParentId) values('029005','日喀则地区',29)
insert into Base_Province(PCode,PName,ParentId) values('029006','阿里地区',29)
insert into Base_Province(PCode,PName,ParentId) values('029007','林芝地区',29)
--30宁夏回族自治区
insert into Base_Province(PCode,PName,ParentId) values('030001','银川市',30)
insert into Base_Province(PCode,PName,ParentId) values('030002','石嘴山市',30)
insert into Base_Province(PCode,PName,ParentId) values('030003','吴忠市',30)
insert into Base_Province(PCode,PName,ParentId) values('030004','固原市',30)
insert into Base_Province(PCode,PName,ParentId) values('030005','中卫市',30)
--31新疆维吾尔自治区(2005年辖:个地级市、个地区、个自治州;个市辖区、个县级市、个县、个自治县)
insert into Base_Province(PCode,PName,ParentId) values('031001','乌鲁木齐市',31)
insert into Base_Province(PCode,PName,ParentId) values('031002','克拉玛依市',31)
insert into Base_Province(PCode,PName,ParentId) values('031003','石河子市',31)
insert into Base_Province(PCode,PName,ParentId) values('031004','阿拉尔市',31)
insert into Base_Province(PCode,PName,ParentId) values('031005','图木舒克市',31)
insert into Base_Province(PCode,PName,ParentId) values('031006','五家渠市',31)
insert into Base_Province(PCode,PName,ParentId) values('031007','吐鲁番市',31)
insert into Base_Province(PCode,PName,ParentId) values('031008','阿克苏市',31)
insert into Base_Province(PCode,PName,ParentId) values('031009','喀什市',31)
insert into Base_Province(PCode,PName,ParentId) values('031010','哈密市',31)
insert into Base_Province(PCode,PName,ParentId) values('031011','和田市',31)
insert into Base_Province(PCode,PName,ParentId) values('031012','阿图什市',31)
insert into Base_Province(PCode,PName,ParentId) values('031013','库尔勒市',31)
insert into Base_Province(PCode,PName,ParentId) values('031014','昌吉市',31)
insert into Base_Province(PCode,PName,ParentId) values('031015','阜康市',31)
insert into Base_Province(PCode,PName,ParentId) values('031016','米泉市',31)
insert into Base_Province(PCode,PName,ParentId) values('031017','博乐市',31)
insert into Base_Province(PCode,PName,ParentId) values('031018','伊宁市',31)
insert into Base_Province(PCode,PName,ParentId) values('031019','奎屯市',31)
insert into Base_Province(PCode,PName,ParentId) values('031020','塔城市',31)
insert into Base_Province(PCode,PName,ParentId) values('031021','乌苏市',31)
insert into Base_Province(PCode,PName,ParentId) values('031022','阿勒泰市',31)
--32内蒙古自治区(2006年,辖:个地级市、个盟;个市辖区、个县级市、个县、个旗、个自治旗。)
insert into Base_Province(PCode,PName,ParentId) values('032001','呼和浩特市',32)
insert into Base_Province(PCode,PName,ParentId) values('032002','包头市',32)
insert into Base_Province(PCode,PName,ParentId) values('032003','乌海市',32)
insert into Base_Province(PCode,PName,ParentId) values('032004','赤峰市',32)
insert into Base_Province(PCode,PName,ParentId) values('032005','通辽市',32)
insert into Base_Province(PCode,PName,ParentId) values('032006','鄂尔多斯市',32)
insert into Base_Province(PCode,PName,ParentId) values('032007','呼伦贝尔市',32)
insert into Base_Province(PCode,PName,ParentId) values('032008','巴彦淖尔市',32)
insert into Base_Province(PCode,PName,ParentId) values('032009','乌兰察布市',32)
insert into Base_Province(PCode,PName,ParentId) values('032010','锡林郭勒盟',32)
insert into Base_Province(PCode,PName,ParentId) values('032011','兴安盟',32)
insert into Base_Province(PCode,PName,ParentId) values('032012','阿拉善盟',32)
--33澳门特别行政区
insert into Base_Province(PCode,PName,ParentId) values('033001','澳门特别行政区',33)
--34香港特别行政区
insert into Base_Province(PCode,PName,ParentId) values('034001','香港特别行政区',34)
//这些数据搞了两个多小时 眼睛都花了
//下面说一下前台 这里是Script里的代码
<%
set myrs=server.CreateObject("adodb.recordset")
mysql="select * from Base_Province where len(PCode)=3 order by ParentId,PCode"
myrs.open mysql,conn,1,2
%>
<script type="text/javascript">
var str="";
var strcity="";
var data = {
<%
do until myrs.eof
j=j+1
set myrscity=server.CreateObject("adodb.recordset")
mysqlcity="select * from Base_Province where len(PCode)>3 and ParentId='"&myrs("ParentId")&"' order by ParentId,PCode"
myrscity.open mysqlcity,conn,1,2
response.Write "'"&myrs("pname")&"':["
i=0
do until myrscity.eof
i=i+1
if i=myrscity.recordcount then response.Write "'"&myrscity("pname")&"'" else response.Write "'"&myrscity("pname")&"',"
myrscity.movenext
loop
if j=myrs.recordcount then response.Write "]" else response.Write "],"
myrs.movenext
loop%>
}
//var data={str};
function loadProv() {
var prov = document.getElementById("prov");
for (var key in data) {
var option = document.createElement("option");
option.value = key;
option.innerText = key;
prov.appendChild(option);
}
}
function prov_change() {
var prov = document.getElementById("prov");
var city = document.getElementById("city");
//清除旧数据
for (var i = city.childNodes.length-1; i >=0; i--) {
city.removeChild(city.childNodes[i]);
}
if (prov.value == "") {//如果是“--请选择省--”
return;
}
var cities = data[prov.value];
for (var i = 0; i < cities.length; i++) {
var option = document.createElement("option");
option.value = cities[i];
option.innerText=cities[i];
city.appendChild(option);
}
}
</script>
这里是控件代码
<tr id="facetoface">
<td height="25" align="right" bgcolor="#E4E4E4">面授地区:</td>
<td height="22" colspan="3" bgcolor="#E4E4E4"><select id="prov" name="prov" onchange="prov_change()">
<option value="">--请选择省--</option>
</select>
<select id="city" name="city">
</select>
</td>
<script type="text/javascript">
loadProv();
loadWbsite();
</script>
这里是验证代码
var face=document.getElementById("facetoface");
var Prov=document.getElementById("prov");
if(face.style.display=="" && Prov.value==""){
alert("请选择面授地区!");
return false;
}
这里是修改数据库代码
ProName=checkstr(request("prov"),2)
CName=checkstr(request("city"),2)
reInfo=IntentionToOrder(order_code,OpenUserID,Privilege_ID,paymoney,cutfee,remark,Lesson_Detail_ids,Lesson_Price,Goods_Detail_ids,Goods_Price,e_mail,s_money)
'更新折扣类型和是否退费
conn.execute("update fqdb.dbo.hqfs_order set Discount_type='"&Discount_Type&"',is_Refund='"&Is_Refund&"',ProvinceName='"&ProName&"',CityName='"&CName&"' where order_code='"&Order_Code&"'")