text: IF $(OneTimeLoad) = 1
  BEGIN
  
  DECLARE @Section TABLE
  (
  SectionKey int NOT NULL PRIMARY KEY,
  PartKey int NOT NULL,
  ParentSectionKey int NULL,
  SectionName nvarchar(250) NOT NULL,
  PageReference nvarchar(50) NULL,
  DisplayOrder float NOT NULL,
  SectionSlug varchar(50) NULL
  
  );
  
  INSERT INTO @Section
  (  SectionKey,
  PartKey,
  ParentSectionKey,
  SectionName,
  PageReference,
  DisplayOrder,
  SectionSlug )
  VALUES
  
  (7002, 25, NULL, N'Part 1 Sword Alone', NULL, 1, 'Part-1'),
  (7003, 25, 7002, N'Plate 1', NULL, 1, 'Plate-1'),
  (7004, 25, 7002, N'Plate 2', NULL, 2, 'Plate-2'),
  (7005, 25, 7002, N'Plate 3', NULL, 3, 'Plate-3'),
  (7006, 25, 7002, N'Plate 4', NULL, 4, 'Plate-4'),
  (7007, 25, 7002, N'Plate 5', NULL, 5, 'Plate-5'),
  (7008, 25, 7002, N'Plate 6', NULL, 6, 'Plate-6'),
  (7009, 25, 7002, N'Plate 7', NULL, 7, 'Plate-7'),
  (7010, 25, 7002, N'Plate 8', NULL, 8, 'Plate-8'),
  (7011, 25, 7002, N'Plate 9', NULL, 9, 'Plate-9'),
  (7012, 25, 7002, N'Plate 10', NULL, 10, 'Plate-10'),
  (7013, 25, 7002, N'Plate 11', NULL, 11, 'Plate-11'),
  (7014, 25, 7002, N'Plate 12', NULL, 12, 'Plate-12'),
  (7015, 25, 7002, N'Plate 13', NULL, 13, 'Plate-13'),
  (7016, 25, 7002, N'Plate 14', NULL, 14, 'Plate-14'),
  (7017, 25, 7002, N'Plate 15', NULL, 15, 'Plate-15'),
  (7018, 25, 7002, N'Plate 16', NULL, 16, 'Plate-16'),
  (7019, 25, 7002, N'Plate 17', NULL, 17, 'Plate-17'),
  (7020, 25, 7002, N'Plate 18', NULL, 18, 'Plate-18'),
  (7021, 25, 7002, N'Plate 19', NULL, 19, 'Plate-19'),
  (7022, 25, 7002, N'Plate 20', NULL, 20, 'Plate-20'),
  (7023, 25, 7002, N'Plate 21', NULL, 21, 'Plate-21'),
  (7024, 25, 7002, N'Plate 22', NULL, 22, 'Plate-22'),
  (7025, 25, 7002, N'Plate 23', NULL, 23, 'Plate-23'),
  (7026, 25, 7002, N'Plate 24', NULL, 24, 'Plate-24'),
  (7027, 25, 7002, N'Plate 25', NULL, 25, 'Plate-25'),
  (7028, 25, 7002, N'Plate 26', NULL, 26, 'Plate-26'),
  (7029, 25, 7002, N'Plate 27', NULL, 27, 'Plate-27'),
  (7030, 25, 7002, N'Plate 28', NULL, 28, 'Plate-28'),
  (7031, 25, 7002, N'Plate 29', NULL, 29, 'Plate-29'),
  (7032, 25, 7002, N'Plate 30', NULL, 30, 'Plate-30'),
  (7033, 25, 7002, N'Plate 31', NULL, 31, 'Plate-31'),
  (7034, 25, 7002, N'Plate 32', NULL, 32, 'Plate-32'),
  (7035, 25, 7002, N'Plate 33', NULL, 33, 'Plate-33'),
  (7036, 25, 7002, N'Plate 34', NULL, 34, 'Plate-34'),
  (7037, 25, 7002, N'Plate 35', NULL, 35, 'Plate-35'),
  (7038, 25, 7002, N'Plate 36', NULL, 36, 'Plate-36'),
  (7039, 25, 7002, N'Plate 37', NULL, 37, 'Plate-37'),
  (7040, 25, 7002, N'Plate 38', NULL, 38, 'Plate-38'),
  (7041, 25, 7002, N'Plate 39', NULL, 39, 'Plate-39'),
  (7042, 25, 7002, N'Plate 40', NULL, 40, 'Plate-40'),
  (7043, 25, 7002, N'Plate 41', NULL, 41, 'Plate-41'),
  (7044, 25, 7002, N'Plate 42', NULL, 42, 'Plate-42'),
  (7045, 25, 7002, N'Plate 43', NULL, 43, 'Plate-43'),
  (7046, 25, 7002, N'Plate 44', NULL, 44, 'Plate-44'),
  (7047, 25, 7002, N'Plate 45', NULL, 45, 'Plate-45'),
  (7048, 25, 7002, N'Plate 46', NULL, 46, 'Plate-46'),
  (7049, 25, 7002, N'Plate 47', NULL, 47, 'Plate-47'),
  (7050, 25, 7002, N'Plate 48', NULL, 48, 'Plate-48'),
  (7051, 25, NULL, N'Part 2 Sword and Dagger', NULL, 2, 'Part-2'),
  (7052, 25, 7051, N'Plate 49', NULL, 1, 'Plate-49'),
  (7053, 25, 7051, N'Plate 50', NULL, 2, 'Plate-50'),
  (7054, 25, 7051, N'Plate 51', NULL, 3, 'Plate-51'),
  (7055, 25, 7051, N'Plate 52', NULL, 4, 'Plate-52'),
  (7056, 25, 7051, N'Plate 53', NULL, 5, 'Plate-53'),
  (7057, 25, 7051, N'Plate 54', NULL, 6, 'Plate-54'),
  (7058, 25, 7051, N'Plate 55', NULL, 7, 'Plate-55'),
  (7059, 25, 7051, N'Plate 56', NULL, 8, 'Plate-56'),
  (7060, 25, 7051, N'Plate 57', NULL, 9, 'Plate-57'),
  (7061, 25, 7051, N'Plate 58', NULL, 10, 'Plate-58'),
  (7062, 25, 7051, N'Plate 59', NULL, 11, 'Plate-59'),
  (7063, 25, 7051, N'Plate 60', NULL, 12, 'Plate-60'),
  (7064, 25, 7051, N'Plate 61', NULL, 13, 'Plate-61'),
  (7065, 25, 7051, N'Plate 62', NULL, 14, 'Plate-62'),
  (7066, 25, 7051, N'Plate 63', NULL, 15, 'Plate-63'),
  (7067, 25, 7051, N'Plate 64', NULL, 16, 'Plate-64'),
  (7068, 25, 7051, N'Plate 65', NULL, 17, 'Plate-65'),
  (7069, 25, 7051, N'Plate 66', NULL, 18, 'Plate-66'),
  (7070, 25, 7051, N'Plate 67', NULL, 19, 'Plate-67'),
  (7071, 25, 7051, N'Plate 68', NULL, 20, 'Plate-68'),
  (7072, 25, 7051, N'Plate 69', NULL, 21, 'Plate-69'),
  (7073, 25, 7051, N'Plate 70', NULL, 22, 'Plate-70'),
  (7074, 25, 7051, N'Plate 71', NULL, 23, 'Plate-71'),
  (7075, 25, 7051, N'Plate 72', NULL, 24, 'Plate-72'),
  (7076, 25, 7051, N'Plate 73', NULL, 25, 'Plate-73'),
  (7077, 25, 7051, N'Plate 74', NULL, 26, 'Plate-74'),
  (7078, 25, 7051, N'Plate 75', NULL, 27, 'Plate-75'),
  (7079, 25, 7051, N'Plate 76', NULL, 28, 'Plate-76'),
  (7080, 25, 7051, N'Plate 77', NULL, 29, 'Plate-77'),
  (7081, 25, 7051, N'Plate 78', NULL, 30, 'Plate-78'),
  (7082, 25, 7051, N'Plate 79', NULL, 31, 'Plate-79'),
  (7083, 25, 7051, N'Plate 80', NULL, 32, 'Plate-80'),
  (7084, 25, 7051, N'Plate 81', NULL, 33, 'Plate-81'),
  (7085, 25, 7051, N'Plate 82', NULL, 34, 'Plate-82'),
  (7086, 25, 7051, N'Plate 83', NULL, 35, 'Plate-83'),
  (7087, 25, 7051, N'Plate 84', NULL, 36, 'Plate-84'),
  (7088, 25, 7051, N'Plate 85', NULL, 37, 'Plate-85'),
  (7089, 25, 7051, N'Plate 86', NULL, 38, 'Plate-86'),
  (7090, 25, 7051, N'Plate 87', NULL, 39, 'Plate-87'),
  (7091, 25, 7051, N'Plate 88', NULL, 40, 'Plate-88'),
  (7092, 25, 7051, N'Plate 89', NULL, 41, 'Plate-89'),
  (7093, 25, 7051, N'Plate 90', NULL, 42, 'Plate-90'),
  (7094, 25, 7051, N'Plate 91', NULL, 43, 'Plate-91'),
  (7095, 25, 7051, N'Plate 92', NULL, 44, 'Plate-92'),
  (7096, 25, 7051, N'Plate 93', NULL, 45, 'Plate-93'),
  (7097, 25, 7051, N'Plate 94', NULL, 46, 'Plate-94'),
  (7098, 25, 7051, N'Plate 95', NULL, 47, 'Plate-95'),
  (7099, 25, NULL, N'Part 3 Sword and Cape', NULL, 3, 'Part-3'),
  (7100, 25, 7099, N'Plate 97', NULL, 1, 'Plate-97'),
  (7101, 25, 7099, N'Plate 98', NULL, 2, 'Plate-98'),
  (7102, 25, 7099, N'Plate 99', NULL, 3, 'Plate-99'),
  (7103, 25, 7099, N'Plate 100', NULL, 4, 'Plate-100'),
  (7104, 25, 7099, N'Plate 101', NULL, 5, 'Plate-101'),
  (7105, 25, 7099, N'Plate 102', NULL, 6, 'Plate-102'),
  (7106, 25, 7099, N'Plate 103', NULL, 7, 'Plate-103'),
  (7107, 25, 7099, N'Plate 104', NULL, 8, 'Plate-104'),
  (7108, 25, 7099, N'Plate 105', NULL, 9, 'Plate-105'),
  (7109, 25, 7099, N'Plate 106', NULL, 10, 'Plate-106'),
  (7110, 25, 7099, N'Plate 107', NULL, 11, 'Plate-107'),
  (7111, 25, 7099, N'Plate 108', NULL, 12, 'Plate-108')
  
  ;
  
  
  MERGE INTO Sources.Section t
  USING @Section s
  ON t.SectionKey = s.SectionKey
  WHEN NOT MATCHED THEN
      INSERT
  (  SectionKey,
  PartKey,
  ParentSectionKey,
  SectionName,
  PageReference,
  DisplayOrder,
  SectionSlug )
      VALUES
      (  s.SectionKey,
  s.PartKey,
  s.ParentSectionKey,
  s.SectionName,
  s.PageReference,
  s.DisplayOrder,
  s.SectionSlug )
  WHEN MATCHED THEN
      UPDATE SET  PartKey = s.PartKey,
  ParentSectionKey = s.ParentSectionKey,
  SectionName = s.SectionName,
  PageReference = s.PageReference,
  DisplayOrder = s.DisplayOrder,
  SectionSlug = s.SectionSlug;
  
  END;
  GO
  