/*
  KJ 20090316: Don't change sortnumber on countries
  KJ 20090309: Removed insert's into Countries - NULL in CountryGroupNumber is ot allowed.
  nbl20090129 Moved after DK_Stat_Update wich update the coutrygroups and countries: todo remove inserts because CountryGroupNumber FK_Constraint does not allow null
*/

Declare @SortNumber int
SET @SortNumber = 0

Update Countries Set Countryname = 'Turkey' where countryCode ='TR'
Update Countries Set Countryname = 'Germany' where countryCode ='D'
Update Countries Set Countryname = 'Other Asia' where countryCode ='OAL'
Update Countries Set Countryname = 'Netherlands' where countryCode ='NL'
--***********************************************************************************

-- Denmark
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'DK')
  UPDATE Countries SET  PhoneFormat='\+\4\5_00000000' WHERE CountryCode LIKE 'DK'

-- Norway
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'N')
  UPDATE Countries SET  PhoneFormat='\+\4\7_00000000' WHERE CountryCode LIKE 'N'

-- Sweden
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'S')
  UPDATE Countries SET  PhoneFormat='\+\4\6_000000000' WHERE CountryCode LIKE 'S'

-- USA
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'USA')
  UPDATE Countries SET  PhoneFormat='\+\1_0000000000' WHERE CountryCode LIKE 'USA'

-- Great Britain
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'GB')
  UPDATE Countries SET  PhoneFormat='\+\4\4_00000000000' WHERE CountryCode LIKE 'GB'

-- Germany
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'D')
  UPDATE Countries SET  PhoneFormat='\+\4\9_000000000009' WHERE CountryCode LIKE 'D'

-- Portugal
SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'P')
  UPDATE Countries SET  PhoneFormat='\+\3\5\1_000000000' WHERE CountryCode LIKE 'P'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'B')
  UPDATE Countries SET  PhoneFormat='\+\3\2_00000000' WHERE CountryCode LIKE 'B'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'AU')
  UPDATE Countries SET  PhoneFormat='\+\6\1_000000000' WHERE CountryCode LIKE 'AU'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'AR')
  UPDATE Countries SET  PhoneFormat='\+\5\4_0000000000' WHERE CountryCode LIKE 'AR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'AL')
  UPDATE Countries SET  PhoneFormat='\+\3\5\5_0000000' WHERE CountryCode LIKE 'AL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'DZ')
  UPDATE Countries SET  PhoneFormat='\+\2\1\3_00000000' WHERE CountryCode LIKE 'DZ'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'AD')
  UPDATE Countries SET  PhoneFormat='\+\3\7\6_000000' WHERE CountryCode LIKE 'AD'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'A')
  UPDATE Countries SET  PhoneFormat='\+\4\3_0000000000000' WHERE CountryCode LIKE 'A'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'BR')
  UPDATE Countries SET  PhoneFormat='\+\5\5_00000000009' WHERE CountryCode LIKE 'BR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'BG')
  UPDATE Countries SET  PhoneFormat='\+\3\5\9_0000000009' WHERE CountryCode LIKE 'BG'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CA')
  UPDATE Countries SET  PhoneFormat='\+\1_0000000000' WHERE CountryCode LIKE 'CA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CL')
  UPDATE Countries SET  PhoneFormat='\+\5\6_00000000' WHERE CountryCode LIKE 'CL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CN')
  UPDATE Countries SET  PhoneFormat='\+\8\6_0000000000' WHERE CountryCode LIKE 'CN'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CO')
  UPDATE Countries SET  PhoneFormat='\+\5\7_00000000' WHERE CountryCode LIKE 'CO'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CG')
  UPDATE Countries SET  PhoneFormat='\+\2\4\2_99999999999' WHERE CountryCode LIKE 'CG'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CR')
  UPDATE Countries SET  PhoneFormat='\+\5\0\6_99999999999' WHERE CountryCode LIKE 'CR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CU')
  UPDATE Countries SET  PhoneFormat='\+\5\3_000000009' WHERE CountryCode LIKE 'CU'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CY')
  UPDATE Countries SET  PhoneFormat='\+\3\5\7_00000000' WHERE CountryCode LIKE 'CY'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CZ')
  UPDATE Countries SET  PhoneFormat='\+\4\2\0_000000000' WHERE CountryCode LIKE 'CZ'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'EG')
  UPDATE Countries SET  PhoneFormat='\+\2\0_00000000' WHERE CountryCode LIKE 'EG'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'EC')
  UPDATE Countries SET  PhoneFormat='\+\5\9\3_00000000' WHERE CountryCode LIKE 'EC'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'EE')
  UPDATE Countries SET  PhoneFormat='\+\3\7\2_0000000' WHERE CountryCode LIKE 'EE'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'FO')
  UPDATE Countries SET  PhoneFormat='\+\2\9\8_99999999999' WHERE CountryCode LIKE 'FO'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'FIN')
  UPDATE Countries SET  PhoneFormat='\+\3\5\8_0000000009' WHERE CountryCode LIKE 'FIN'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'F')
  UPDATE Countries SET  PhoneFormat='\+\3\3_000000000' WHERE CountryCode LIKE 'F'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'GR')
  UPDATE Countries SET  PhoneFormat='\+\3\0_0000000000' WHERE CountryCode LIKE 'GR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'GT')
  UPDATE Countries SET  PhoneFormat='\+\5\0\2_00000000' WHERE CountryCode LIKE 'GT'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'HU')
  UPDATE Countries SET  PhoneFormat='\+\3\6_00000000' WHERE CountryCode LIKE 'HU'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IS')
  UPDATE Countries SET  PhoneFormat='\+\3\5\4_99999999999' WHERE CountryCode LIKE 'IS'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'HT')
  UPDATE Countries SET  PhoneFormat='\+\5\0\9_0000000' WHERE CountryCode LIKE 'HT'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IN')
  UPDATE Countries SET  PhoneFormat='\+\9\1_0000000000' WHERE CountryCode LIKE 'IN'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'ID')
  UPDATE Countries SET  PhoneFormat='\+\6\2_00000000009' WHERE CountryCode LIKE 'ID'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IRL')
  UPDATE Countries SET  PhoneFormat='\+\3\5\3_000000000' WHERE CountryCode LIKE 'IRL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IR')
  UPDATE Countries SET  PhoneFormat='\+\9\8_0000000000' WHERE CountryCode LIKE 'IR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IQ')
  UPDATE Countries SET  PhoneFormat='\+\9\6\4_000000009' WHERE CountryCode LIKE 'IQ'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'IL')
  UPDATE Countries SET  PhoneFormat='\+\9\7\2_00000000' WHERE CountryCode LIKE 'IL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'I')
  UPDATE Countries SET  PhoneFormat='\+\3\9_0000000000' WHERE CountryCode LIKE 'I'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'JP')
  UPDATE Countries SET  PhoneFormat='\+\8\1_000000000' WHERE CountryCode LIKE 'JP'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'JO')
  UPDATE Countries SET  PhoneFormat='\+\9\6\2_00000000' WHERE CountryCode LIKE 'JO'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'KE')
  UPDATE Countries SET  PhoneFormat='\+\2\5\4_0000000009' WHERE CountryCode LIKE 'KE'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LB')
  UPDATE Countries SET  PhoneFormat='\+\9\6\1_0000000' WHERE CountryCode LIKE 'LB'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LY')
  UPDATE Countries SET  PhoneFormat='\+\2\1\8_0000000009' WHERE CountryCode LIKE 'LY'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LI')
  UPDATE Countries SET  PhoneFormat='\+\4\2\3_0000000' WHERE CountryCode LIKE 'LI'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'L')
  UPDATE Countries SET  PhoneFormat='\+\3\5\2_99999999999' WHERE CountryCode LIKE 'L'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'MT')
  UPDATE Countries SET  PhoneFormat='\+\3\5\6_99999999999' WHERE CountryCode LIKE 'MT'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'MX')
  UPDATE Countries SET  PhoneFormat='\+\5\2_0000000000' WHERE CountryCode LIKE 'MX'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'MC')
  UPDATE Countries SET  PhoneFormat='\+\3\7\7_00000000' WHERE CountryCode LIKE 'MC'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'MA')
  UPDATE Countries SET  PhoneFormat='\+\2\5\2_00000000' WHERE CountryCode LIKE 'MA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'NL')
  UPDATE Countries SET  PhoneFormat='\+\3\1_000000000' WHERE CountryCode LIKE 'NL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'NZ')
  UPDATE Countries SET  PhoneFormat='\+\6\4_00000000' WHERE CountryCode LIKE 'NZ'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'NI')
  UPDATE Countries SET  PhoneFormat='\+\5\0\5_0000000' WHERE CountryCode LIKE 'NI'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PK')
  UPDATE Countries SET  PhoneFormat='\+\9\2_000000000' WHERE CountryCode LIKE 'PK'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PA')
  UPDATE Countries SET  PhoneFormat='\+\5\0\7_0000000' WHERE CountryCode LIKE 'PA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PY')
  UPDATE Countries SET  PhoneFormat='\+\5\9\5_000000000' WHERE CountryCode LIKE 'PY'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PE')
  UPDATE Countries SET  PhoneFormat='\+\5\1_00000000' WHERE CountryCode LIKE 'PE'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PH')
  UPDATE Countries SET  PhoneFormat='\+\6\3_000000000009' WHERE CountryCode LIKE 'PH'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'PL')
  UPDATE Countries SET  PhoneFormat='\+\4\8_0000000009' WHERE CountryCode LIKE 'PL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'RO')
  UPDATE Countries SET  PhoneFormat='\+\4\0_000000000' WHERE CountryCode LIKE 'RO'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'RU')
  UPDATE Countries SET  PhoneFormat='\+\7_0000000000' WHERE CountryCode LIKE 'RU'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SA')
  UPDATE Countries SET  PhoneFormat='\+\9\6\6_00000000' WHERE CountryCode LIKE 'SA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'E')
  UPDATE Countries SET  PhoneFormat='\+\3\4_000000000' WHERE CountryCode LIKE 'E'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SG')
  UPDATE Countries SET  PhoneFormat='\+\6\5_00000000' WHERE CountryCode LIKE 'SG'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'ZA')
  UPDATE Countries SET  PhoneFormat='\+\2\7_000000000' WHERE CountryCode LIKE 'ZA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'CH')
  UPDATE Countries SET  PhoneFormat='\+\4\1_0000000009' WHERE CountryCode LIKE 'CH'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LK')
  UPDATE Countries SET  PhoneFormat='\+\9\4_0000000009' WHERE CountryCode LIKE 'LK'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SY')
  UPDATE Countries SET  PhoneFormat='\+\9\6\3_0000000009' WHERE CountryCode LIKE 'SY'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'TH')
  UPDATE Countries SET  PhoneFormat='\+\6\6_00000000' WHERE CountryCode LIKE 'TH'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'TN')
  UPDATE Countries SET  PhoneFormat='\+\2\1\6_00000000' WHERE CountryCode LIKE 'TN'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'TR')
  UPDATE Countries SET  PhoneFormat='\+\9\0_0000000000' WHERE CountryCode LIKE 'TR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'UY')
  UPDATE Countries SET  PhoneFormat='\+\5\9\8_0000000' WHERE CountryCode LIKE 'UY'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'VA')
  UPDATE Countries SET  PhoneFormat='\+\3\9_0000000000' WHERE CountryCode LIKE 'VA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'VE')
  UPDATE Countries SET  PhoneFormat='\+\5\9\8_0000000' WHERE CountryCode LIKE 'VE'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'VN')
  UPDATE Countries SET  PhoneFormat='\+\8\4_00000000' WHERE CountryCode LIKE 'VN'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SC')
  UPDATE Countries SET  PhoneFormat='\+\3\8\1_0000000000' WHERE CountryCode LIKE 'SC'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'GL')
  UPDATE Countries SET  PhoneFormat='\+\4\5_00000000' WHERE CountryCode LIKE 'GL'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LV')
  UPDATE Countries SET  PhoneFormat='\+\3\7\1_0000000' WHERE CountryCode LIKE 'LV'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LT')
  UPDATE Countries SET  PhoneFormat='\+\3\9\0_00000000' WHERE CountryCode LIKE 'LT'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SK')
  UPDATE Countries SET  PhoneFormat='\+\4\2\1_000000000' WHERE CountryCode LIKE 'SK'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SI')
  UPDATE Countries SET  PhoneFormat='\+\3\8\6_00000000' WHERE CountryCode LIKE 'SI'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'UA')
  UPDATE Countries SET  PhoneFormat='\+\3\8\0_000000000' WHERE CountryCode LIKE 'UA'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'KR')
  UPDATE Countries SET  PhoneFormat='\+\8\2_00000000009' WHERE CountryCode LIKE 'KR'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LV')
  UPDATE Countries SET  PhoneFormat='\+\3\7\1_0000000' WHERE CountryCode LIKE 'LV'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'LT')
  UPDATE Countries SET  PhoneFormat='\+\3\7\0_00000000' WHERE CountryCode LIKE 'LT'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SK')
  UPDATE Countries SET  PhoneFormat='\+\4\2\1_000000000' WHERE CountryCode LIKE 'SK'

SET @SortNumber = @SortNumber + 1
if exists(SELECT CountryCode FROM Countries WHERE CountryCode LIKE 'SI')
  UPDATE Countries SET  PhoneFormat='\+\3\8\6_00000000' WHERE CountryCode LIKE 'SI'


--*************************************************************************************
-- Update SortNumbers on "Other"-countries/areas
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OA1'
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OE'
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OAL'
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OW'
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OA'
SET @SortNumber = @SortNumber + 1
UPDATE Countries SET SortNumber=@SortNumber WHERE CountryCode LIKE 'OT'

--*************************************************************************************
-- Update EU-membership
UPDATE Countries SET MemberOfEU=0
UPDATE Countries SET MemberOfEU=1 WHERE CountryCode IN ('DK', 'S', 'GB', 'D', 'P', 'B', 'A', 'CY', 'CZ', 'EE', 'FIN', 'F', 'GR', 'HU', 'IRL', 'I', 'L', 'MT', 'NL', 'PL', 'E', 'LV', 'LT', 'SK', 'SI')

-- Update EU-Euro-membership
UPDATE Countries SET MemberOfEUMoney=0
UPDATE Countries SET MemberOfEUMoney=1 WHERE CountryCode IN ('D', 'P', 'B', 'A', 'EE', 'FIN', 'F', 'GR', 'IRL', 'I', 'L', 'NL')

--*************************************************************************************


