DECLARE @dkCountryNumber INT

SELECT @dkCountryNumber = CountryNumber FROM Countries WITH (NOLOCK) WHERE countryCode = 'DK'

UPDATE Zipcodes SET CityName = 'Randers C' 
WHERE ZipCode = '8900'
AND CountryNumber = @dkCountryNumber


IF NOT EXISTS (SELECT * FROM ZipCodes WITH (NOLOCK) WHERE ZipCode = '8920' AND CountryNumber = @dkCountryNumber)
  INSERT INTO ZipCodes (ZipCode, CityName, CountryNumber) VALUES ('8920', 'Randers NV', @dkCountryNumber)
IF NOT EXISTS (SELECT * FROM ZipCodes WITH (NOLOCK) WHERE ZipCode = '8930' AND CountryNumber = @dkCountryNumber)
  INSERT INTO ZipCodes (ZipCode, CityName, CountryNumber) VALUES ('8930', 'Randers NŲ', @dkCountryNumber)
IF NOT EXISTS (SELECT * FROM ZipCodes WITH (NOLOCK) WHERE ZipCode = '8940' AND CountryNumber = @dkCountryNumber)
  INSERT INTO ZipCodes (ZipCode, CityName, CountryNumber) VALUES ('8940', 'Randers SV', @dkCountryNumber)
IF NOT EXISTS (SELECT * FROM ZipCodes WITH (NOLOCK) WHERE ZipCode = '8960' AND CountryNumber = @dkCountryNumber)
  INSERT INTO ZipCodes (ZipCode, CityName, CountryNumber) VALUES ('8960', 'Randers SŲ', @dkCountryNumber)
