In SQL Server, you can ensure uniqueness by using an indexed view. You will also need a number table (if you do not already have it) in the same database as yours Table A.
Here is my testing script with some comments:
CREATE TABLE MyNumbersTable (Value int);
INSERT INTO MyNumbersTable
SELECT 1 UNION ALL
SELECT 2;
GO
CREATE TABLE MyUniqueCities (
ID int IDENTITY,
City1 varchar(50) NOT NULL,
City2 varchar(50) NOT NULL
);
GO
CREATE VIEW MyIndexedView
WITH SCHEMABINDING
AS
SELECT
City = CASE t.Value
WHEN 1 THEN u.City1
WHEN 2 THEN u.City2
END
FROM dbo.MyUniqueCities u
INNER JOIN dbo.MyNumbersTable t
ON t.Value BETWEEN 1 AND 2
GO
CREATE UNIQUE CLUSTERED INDEX UIX_MyIndexedView ON MyIndexedView (City)
GO
INSERT INTO MyUniqueCities VALUES ('London', 'New York');
INSERT INTO MyUniqueCities VALUES ('Amsterdam', 'Prague');
INSERT INTO MyUniqueCities VALUES ('Melbourne', 'London');
GO
DROP VIEW MyIndexedView
DROP TABLE MyUniqueCities
DROP TABLE MyNumbersTable
GO
: