	--01 Add rows to @CD_City
	DECLARE @CD_City TABLE ([City_Code] INT NOT NULL, [City_Name] NVARCHAR(50) NOT NULL, [Area_Name] NVARCHAR(50) NULL, [Region_Name] NVARCHAR(50) NULL);

	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (1, N'Aarau', N'Aarau', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (2, N'Aarberg', N'Aarberg', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (3, N'Aarburg', N'Zonfingen', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (4, N'Adliswil', N'Horgen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (5, N'Affoltern am Albis', N'Affoltern', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (6, N'Agno', N'Lugano', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (7, N'Aigle', N'Aigle', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (8, N'Allschwil', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (9, N'Altdorf', NULL, N'Uri')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (10, N'Altst?tten', N'Rheintal', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (11, N'Amriswil', N'Bischofszell', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (12, N'Appenzell', N'Appenzell', N'Appenzell Innerrhoden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (13, N'Arbon', N'Arbon', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (14, N'Ascona', N'Locarno', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (15, N'Aubonne', N'Aubonne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (16, N'Avenches', N'Avenches', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (17, N'Baar', NULL, N'Zug')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (18, N'Baden', N'Baden', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (19, N'Basel', NULL, N'Basel-City')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (20, N'Bellinzona', N'Bellinzona', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (21, N'Berne', N'Berne', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (22, N'Berom?nster', N'Sursee', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (23, N'Biasca', N'Riviera', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (24, N'Biel/Bienne', N'Biel', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (25, N'Binningen', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (26, N'Birsfelden', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (27, N'Bischofszell', N'Bischofszell', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (28, N'Boudry', N'Boudry', N'Neuch?tel')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (29, N'Bourg-Saint-Pierre', N'Entremont', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (30, N'Bremgarten', N'Bremgarten', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (31, N'Brig', N'Brig', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (32, N'Brugg', N'Brugg', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (33, N'Buchs', N'Werdenberg', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (34, N'Bulle', N'Gruy?re', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (35, N'B?lach', N'B?lach', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (36, N'Burgdorf', N'Burgdorf', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (37, N'Carouge', NULL, N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (38, N'Cham', NULL, N'Zug')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (39, N'Ch?tel-Saint-Denis', N'Veveyse', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (40, N'Chur', N'Plessur', N'Graub?nden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (41, N'Conthey', N'Conthey', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (42, N'Coppet', N'Nyon', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (43, N'Cossonay', N'Cossonay', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (44, N'Croglio', N'Lugano', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (45, N'Cudrefin', N'Avenches', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (46, N'Cully', N'Lavaux', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (47, N'Davos', N'Pr?ttigau/Davos', N'Graub?nden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (48, N'Del?mont', N'Del?mont', N'Jura')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (49, N'Diessenhofen', N'Diessenhofen', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (50, N'Dietikon', N'Dietikon', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (51, N'D?bendorf', N'Uster', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (52, N'Ebikon', N'Lucerne', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (53, N'Echallens', N'Echallens', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (54, N'Eglisau', N'B?lach', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (55, N'Einsiedeln', N'Einsiedeln', N'Schwyz')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (56, N'Elgg', N'Winterthur', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (57, N'Emmen', N'Hochdorf', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (58, N'Erlach', N'Erlach', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (59, N'Estavayer-le-Lac', N'Broye', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (60, N'Frauenfeld', N'Frauenfeld', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (61, N'Freienbach', N'H?fe', N'Schwyz')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (62, N'Fribourg', N'Sarine/Saane (district)', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (63, N'Geneva', NULL, N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (64, N'Gland', N'Nyon', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (65, N'Glarus', NULL, N'Glarus')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (66, N'Gordola', N'Locarno', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (67, N'Gossau', N'St. Gallen', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (68, N'Grandcour', N'Payerne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (69, N'Grandson', N'Grandson', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (70, N'Greifensee', N'Uster', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (71, N'Grenchen', N'Lebern', N'Solothurn')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (72, N'Gr?ningen', N'Hinwil', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (73, N'Gruy?res', N'Gruy?re', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (74, N'Herisau', NULL, N'Appenzell Ausserrhoden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (75, N'Hermance', NULL, N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (76, N'Horgen', N'Horgen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (77, N'Horw', N'Lucerne', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (78, N'Huttwil', N'Trachselwald', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (79, N'Ilanz', N'Surselva', N'Graubnden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (80, N'Illnau-Effretikon', N'Pfהffikon', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (81, N'Ittigen', N'Berne', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (82, N'Kaiserstuhl', N'Zurzach', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (83, N'Klingnau', N'Zurzach', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (84, N'Kloten', N'Blach', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (85, N'Kצniz', N'Berne', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (86, N'Kreuzlingen', N'Kreuzlingen', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (87, N'Kriens', N'Lucerne', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (88, N'Ksnacht', N'Meilen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (89, N'Kssnacht', N'Kssnacht', N'Schwyz')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (90, N'La Chaux-de-Fonds', N'La Chaux-de-Fonds', N'Neuchגtel')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (91, N'La Neuveville', N'La Neuveville', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (92, N'La Sarraz', N'Cossnoay', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (93, N'La Tour-de-Peilz', N'Vevey', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (94, N'La Tour-de-Trךme', N'Gruyטre', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (95, N'Le Landeron', N'Neuchגtel', N'Neuchגtel')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (96, N'Le Locle', N'Le Locle', N'Neuchגtel')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (97, N'Les Clיes', N'Orbe', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (98, N'Lachen', N'March', N'Schwyz')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (99, N'Lancy', N'NULL', N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (100, N'Langenthal', N'Aarwangen', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (101, N'Laufen', N'Laufen', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (102, N'Laufenburg', N'Laufenburg', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (103, N'Laupen', N'Laupen', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (104, N'Lausanne', N'Lausanne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (105, N'Lenzburg', N'Lenzburg', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (106, N'Leuk', N'Leuk', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (107, N'Lichtensteig', N'Toggenburg', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (108, N'Liestal', N'Liestal', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (109, N'Littau', N'Lucerne', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (110, N'Locarno', N'Locarno', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (111, N'Losone', N'Locarno', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (112, N'Lugano', N'Lugano', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (113, N'Lutry', N'Lavaux', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (114, N'Lucerne', N'Lucerne', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (115, N'Lyss', N'Aarberg', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (116, N'Maienfeld', N'Landquart', N'Graubnden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (117, N'Martigny', N'Martigny', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (118, N'Meilen', N'Meilen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (119, N'Mellingen', N'Baden', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (120, N'Mendrisio', N'Mendrisio', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (121, N'Meyrin', N'NULL', N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (122, N'Monthey', N'Monthey', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (123, N'Montreux', N'Vevey', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (124, N'Morcote', N'Lugano', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (125, N'Morges', N'Morges', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (126, N'Moudon', N'Moudon', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (127, N'Moutier', N'Moutier', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (128, N'Mnchenstein', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (129, N'Mnsingen', N'Konolfingen', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (130, N'Muri', N'Berne', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (131, N'Murten', N'See', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (132, N'Muttenz', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (133, N'Neuchגtel', N'Neuchגtel', N'Neuchגtel')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (134, N'Neuhausen', N'NULL', N'Schaffhausen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (135, N'Neunkirch', N'NULL', N'Schaffhausen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (136, N'Nidau', N'Nidau', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (137, N'Nyon', N'Nyon', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (138, N'Oftringen', N'Zofingen', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (139, N'Olten', N'Olten', N'Solothurn')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (140, N'Onex', N'NULL', N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (141, N'Opfikon', N'Blach', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (142, N'Orbe', N'Orbe', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (143, N'Orsiטres', N'Entremont', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (144, N'Ostermundigen', N'Berne', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (145, N'Payerne', N'Payerne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (146, N'Porrentruy', N'Porrentruy', N'Jura')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (147, N'Pratteln', N'Liestal', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (148, N'Prilly', N'Lausanne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (149, N'Pully', N'Lausanne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (150, N'Rapperswil-Jona', N'See-Gaster', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (151, N'Regensberg', N'Dielsdorf', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (152, N'Regensdorf', N'Dielsdorf', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (153, N'Reinach', N'Arlesheim', N'Basel-Country')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (154, N'Renens', N'Lausanne', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (155, N'Rheinau', N'Andelfingen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (156, N'Rheineck', N'Rheintal', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (157, N'Rheinfelden', N'Rheinfelden', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (158, N'Richterswil', N'Horgen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (159, N'Riehen', N'NULL', N'Basel-City')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (160, N'Riva San Vitale', N'Mendrisio', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (161, N'Rolle', N'Rolle', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (162, N'Romainmפtier', N'Orbe', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (163, N'Romont', N'Glane', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (164, N'Rorschach', N'Rorschach', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (165, N'Rue', N'Glane', N'Fribourg')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (166, N'Rti', N'Hinwil', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (167, N'Saillon', N'Martigny', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (168, N'Saint-Maurice', N'Saint-Maurice', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (169, N'Saint-Prex', N'Morges', N'Vaud')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (170, N'Saint-Ursanne', N'Porrentruy', N'Jura')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (171, N'Sala', N'Lugano', N'Ticino')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (172, N'St. Gallen', N'St. Gallen', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (173, N'Sargans', N'Sarganserland', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (174, N'Sarnen', N'NULL', N'Obwalden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (175, N'Schaffhausen', N'NULL', N'Schaffhausen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (176, N'Schlieren', N'Dietikon', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (177, N'Schwyz', N'Schwyz', N'Schwyz')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (178, N'Sembrancher', N'Entremont', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (179, N'Sempach', N'Sursee', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (180, N'Sierre', N'Sierre', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (181, N'Sion', N'Sion', N'Valais')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (182, N'Solothurn', N'Solothurn', N'Solothurn')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (183, N'Spiez', N'Niedersimmental', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (184, N'Spreitenbach', N'Baden', N'Aargau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (185, N'Splgen', N'Hinterrhein', N'Graubnden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (186, N'Stהfa', N'Meilen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (187, N'Stans', N'NULL', N'Nidwalden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (188, N'Steckborn', N'Steckborn', N'Thurgau')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (189, N'Steffisburg', N'Thun', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (190, N'Stein am Rhein', N'NULL', N'Schaffhausen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (191, N'Sursee', N'Sursee', N'Lucerne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (192, N'Thalwil', N'Horgen', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (193, N'Thפnex', N'NULL', N'Geneva')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (194, N'Thun', N'Thun', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (195, N'Thusis', N'Hinterrhein', N'Graubnden')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (196, N'Unterseen', N'Interlaken', N'Berne')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (197, N'Uznach', N'See-Gaster', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (198, N'Uster', N'Uster', N'Zurich')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (199, N'Uzwil', N'Wil', N'St. Gallen')
	INSERT INTO @CD_City ([City_Code], [City_Name], [Area_Name], [Region_Name]) VALUES (200, N'Valangin', N'Val-de-Ruz', N'Neuchגtel')

	MERGE INTO dbo.[CD_City] AS TARGET  
	USING @CD_City AS SOURCE  
	ON TARGET.[City_Code] = SOURCE.[City_Code]  
	WHEN MATCHED THEN    
	UPDATE SET 
		[City_Name] = SOURCE.[City_Name],
		[Area_Name] = SOURCE.[Area_Name],
		[Region_Name] = SOURCE.[Region_Name]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([City_Code], [City_Name], [Area_Name], [Region_Name])   
	VALUES (SOURCE.[City_Code],SOURCE.[City_Name], SOURCE.[Area_Name], SOURCE.[Region_Name])  
	OUTPUT $action, SOURCE.*;


	--02. Add rows to [dbo].[CD_Event_Status]
	DECLARE @CD_Event_Status TABLE ([Event_Status_Code] TINYINT NOT NULL, [Name] VARCHAR(30) NOT NULL, [Description] VARCHAR(300) NOT NULL);
	
	INSERT INTO @CD_Event_Status ([Event_Status_Code], [Name], [Description]) VALUES (0, 'Open', 'The event trigger is open/activated')
	INSERT INTO @CD_Event_Status ([Event_Status_Code], [Name], [Description]) VALUES (1, 'Closed', 'The event trigger is deactivated/closed')
	INSERT INTO @CD_Event_Status ([Event_Status_Code], [Name], [Description]) VALUES (2, 'Detection', 'A momentary detection (such AS from a motion detector) has triggered an event')
	INSERT INTO @CD_Event_Status ([Event_Status_Code], [Name], [Description]) VALUES (3, 'Not Available', 'Status is irrelevant (eg: informational message)')

	MERGE INTO dbo.[CD_Event_Status] AS TARGET  
	USING @CD_Event_Status AS SOURCE  
	ON TARGET.[Event_Status_Code] = SOURCE.[Event_Status_Code]  
	WHEN MATCHED THEN    
	UPDATE SET
		[Name] = SOURCE.[Name],
		[Description] = SOURCE.[Description]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Event_Status_Code], [Name], [Description])   
	VALUES (SOURCE.[Event_Status_Code],SOURCE.[Name], SOURCE.[Description])  
	OUTPUT $action, SOURCE.*;



	--03. Add rows to [dbo].[CD_Event_Type]
	DECLARE @CD_Event_Type TABLE ([Event_Type] TINYINT NOT NULL, [Name] VARCHAR(30) NOT NULL, [Description] VARCHAR(200) NOT NULL);

	INSERT INTO @CD_Event_Type ([Event_Type], [Name], [Description]) VALUES (0, 'Security', 'Security events')
	INSERT INTO @CD_Event_Type ([Event_Type], [Name], [Description]) VALUES (1, 'Safety', 'Safety alerts (eg: smoke detection, flood alarm, etc)')
	INSERT INTO @CD_Event_Type ([Event_Type], [Name], [Description]) VALUES (2, 'Technical', 'Technical alerts (eg: low battery)')
	INSERT INTO @CD_Event_Type ([Event_Type], [Name], [Description]) VALUES (3, 'Informational', 'Informational messages (eg: control panel''s GSM coverage data)')
	INSERT INTO @CD_Event_Type ([Event_Type], [Name], [Description]) VALUES (4, 'Comfort', 'Value Added messages (eg: access control messages)')

	MERGE INTO dbo.[CD_Event_Type] AS TARGET  
	USING @CD_Event_Type AS SOURCE  
	ON TARGET.[Event_Type] = SOURCE.[Event_Type]  
	WHEN MATCHED THEN    
	UPDATE SET
		[Name] = SOURCE.[Name],
		[Description] = SOURCE.[Description]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Event_Type], [Name], [Description])   
	VALUES (SOURCE.[Event_Type],SOURCE.[Name], SOURCE.[Description])  
	OUTPUT $action, SOURCE.*;

	--04. Add rows to [dbo].[CD_Firmware_Target_Device]
	DECLARE @CD_Firmware_Target_Device TABLE ([Target_Device_Code] TINYINT NOT NULL, [Target_Description] NVARCHAR(50) NULL);

	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (0, N'Verisure CPU_A')
	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (1, N'Verisure CPU_C')
	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (4, N'Verifast CPU_A')
	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (5, N'Verifast CPU_C')
	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (7, N'KPD main')
	INSERT INTO @CD_Firmware_Target_Device ([Target_Device_Code], [Target_Description]) VALUES (8, N'IVD main')

	MERGE INTO dbo.[CD_Firmware_Target_Device] AS TARGET  
	USING @CD_Firmware_Target_Device AS SOURCE  
	ON TARGET.[Target_Device_Code] = SOURCE.[Target_Device_Code]  
	WHEN MATCHED THEN    
	UPDATE SET [Target_Description] = SOURCE.[Target_Description]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Target_Device_Code], [Target_Description])   
	VALUES (SOURCE.[Target_Device_Code],SOURCE.[Target_Description])  
	OUTPUT $action, SOURCE.*;


	--05. Add rows to [dbo].[CD_Language]
if not exists(select 1 from [dbo].[CD_Language])
BEGIN
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (1, N'English', N'English', N'en-US', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (2, N'Spanish', N'Español', N'es-ES', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (3, N'French', N'Franחais', N'fr-FR', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (4, N'Hebrew', N'עברית', N'he-IL', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (5, N'Russian', N'Русский', N'ru-RU', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (6, N'Italian', N'Italiano', N'it-IT', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (7, N'Finnish', N'Suomi', N'fi-FI', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (8, N'Swedish', N'Svenska', N'sv-SE', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (9, N'Chinese', N'中国', N'zh-CN', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (10, N'SpanishChile', N'Español(CL)', N'es-CL', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (11, N'Danish', N'Danish', N'da-DK', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (12, N'ItalianSwiss', N'Italian(Swiss)', N'it-ch', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (13, N'GermanSwiss', N'German(Swiss)', N'de-ch', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (14, N'FrenchSwiss', N'French(Swiss)', N'fr-ch', 1)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (15, N'German', N'Deutsch', N'de-DE', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (16, N'Portuguese', N'Portuguךs', N'pt-PT', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (17, N'Hungarian', N'magyar', N'hu-HU', 0)
	INSERT [dbo].[CD_Language] ([LanguageCode], [LanguageNameEnglish], [LanguageNameLocal], [CultureName], [IsEnabled]) VALUES (18, N'Dutch', N'Nederlands', N'nl-NL', 1)
END






	--06. Add rows to [dbo].[CD_Manufacturer]
	DECLARE @CD_Manufacturer TABLE ([Manufacturer_Code] TINYINT NOT NULL, [Manufacturer_Name] NVARCHAR(50) NULL);

	INSERT INTO @CD_Manufacturer ([Manufacturer_Code], [Manufacturer_Name]) VALUES (1, N'ESI Production Line 1')
	INSERT INTO @CD_Manufacturer ([Manufacturer_Code], [Manufacturer_Name]) VALUES (2, N'ESI Production Line 2')
	INSERT INTO @CD_Manufacturer ([Manufacturer_Code], [Manufacturer_Name]) VALUES (3, N'N/A')

	MERGE INTO dbo.[CD_Manufacturer] AS TARGET  
	USING @CD_Manufacturer AS SOURCE  
	ON TARGET.[Manufacturer_Code] = SOURCE.[Manufacturer_Code]  
	WHEN MATCHED THEN    
	UPDATE SET [Manufacturer_Name] = SOURCE.[Manufacturer_Name]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Manufacturer_Code], [Manufacturer_Name])   
	VALUES (SOURCE.[Manufacturer_Code],SOURCE.[Manufacturer_Name])  
	OUTPUT $action, SOURCE.*;


	--07 Add row to [dbo].[CD_Message_Protocol]
	DECLARE @CD_Message_Protocol TABLE ([Protocol_Id] TINYINT NOT NULL, [Name] VARCHAR(50) NOT NULL, [Description] VARCHAR(200) NOT NULL);

	INSERT INTO @CD_Message_Protocol ([Protocol_Id], [Name], [Description]) VALUES (0, 'SDES', 'Spanish Iridium Verisure POSESA protocol')
	INSERT INTO @CD_Message_Protocol ([Protocol_Id], [Name], [Description]) VALUES (1, 'ECOP', '')

	MERGE INTO dbo.[CD_Message_Protocol] AS TARGET  
	USING @CD_Message_Protocol AS SOURCE  
	ON TARGET.[Protocol_Id] = SOURCE.[Protocol_Id]  
	WHEN MATCHED THEN    
	UPDATE SET [Name] = SOURCE.[Name], [Description] = SOURCE.[Description]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Protocol_Id], [Name], [Description])   
	VALUES (SOURCE.[Protocol_Id], SOURCE.[Name], SOURCE.[Description])  
	OUTPUT $action, SOURCE.*;
