Both databases have the same schema, but they may experience conflict with primary key in some tables. So I want them to just ignore the duplicate rows, and continue merging
I know this is an old topic but I have to comment on the general approach I see in many posts and that is trying to do everything natively using SQL queries. What such solutions have in common is the fairly large amount of time that needs to be spent on creating and testing a query before applying it.
So yes – you can merge two databases natively using relatively complex queries but you can save yourself a ton of time and use third party tools for free (most or all have fully functional free trial).
There are ton of these on the market. Red Gate, already mentioned in other post, is one of the best but you can also try ApexSQL Data Diff, dbForge, SQL Comparison toolset and many others.