How do I go about creating a script to compare , update and match structure of two databases I am comparing two databases using Opendiff which is similar to sqlCompare. 

I have two databases which should match in structure so as I compare I would like to construct a script such that if the one DB has a specific table that the other DB doesn't have it creates that table so that the structure and collation in the two databases matches . 

I am using SQL Server 2012.

Thanks
SQL Server Data Tools comes with Schema Compare (and a lot more).

1) Import either DB to a Database Project.


2) Bi-direction Schema Compare to remaining DB. Import and Deploy changes as necessary.


3) Save Solution to Source Control and deploy the exact same DB to any number of servers.

At any stage you can either script out the operations or simply execute it from the UI. The script includes checks to prevent data loss or other unwanted issues, but it's best to review especially if you're new to the tool.