I have inserted data from sql insert files into an ms sql database. Apperantly this data is not fully complete.
I discovered this when I was trying to make the ERD and create key constraints between tables.
When I try to connect article_review with order1 where order1 has a primary key and article review has a foreign key.
I have a query where it selects all records with non-matching key values:
see image: http://imgur.com/vDbCuG8
So what I want to do now:
insert new rows into article_review with the missing ID values. The values of the other columns do not really matter, they can be NULL or random generated.
A simple join won't really cut it because all of the other columns are non-identical.
ps. all above is needed because ms sql 2016 wont let me create a key constraint between 2 tables where one of them contains a value that is not in the other one and thus throws the error:
'order1' table saved successfully
'article_review' table saved successfully
- Unable to create relationship 'FK_review_order1'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_review_order1". The conflict occurred in database "superDatabase", table "dbo.order1", column 'id'.