Here is my other mistake I can't fight:
I am trying to add (INSERT INTO sql statement) a unique records from the WHID field (ClientEpisode table) into WHID field (EHREpisode table):
INSERT INTO
[WH].[Fact].EHREpisode ([WHID])
SELECT
[HP].[bhcms5].ClientEpisode.WHID
FROM
[HP].[bhcms5].ClientEpisode
Both of the WHID fields are unique (non duplicated) in both tables, and between each others, but I keep having an error:
Plz, see the error message, in bigger letters:
"Cannot insert duplicate key row in object 'Fact.EHREpisode' with unique index 'IX_EHREpisode'. The duplicate key value is (NULL, NULL>). The statement has been terminated."
Below are my tables structures: