1

I have a database that has been updated, many columns have been added. Currently the only way of returning the differences between the two databases is by going through the database.cs class that is autogenerated and comparing it with the old database.cs file. I have both database on Sql Server Management Studio (the new structure, and the old structure of the databsae) and want to see all the differences. How can I return the differences between the databases and tables.

E.g.

OLD Db  New Db
TabA    TabA
Col1    Col1
Col2    Col2
Col3    Col3
        Col4

Output
Col4 int not null
4
  • Get a tool. Writing a script to do this is a good example of re-inventing the wheel. Commented Nov 23, 2015 at 17:50
  • Have you looked at sql-dbdiff ?
    – Kin Shah
    Commented Nov 23, 2015 at 17:55
  • Sure! Please read the post I linked. I recommend Red Gate's tool if you have budget; if you need free, there are several options there, but you'll need to try them, because I haven't. Commented Nov 23, 2015 at 17:59
  • @Kin I am now, but for some network related instance it keeps crashing. Commented Nov 23, 2015 at 18:01

1 Answer 1

3

You can use the applications listed in comments, or use SQL Server Data Tools. What I like about SSDT is it is a native SQL Server development environment, works well with source control, and has a really good set of features for database development.

You should be able to install from your SQL Server 2014 media or just download it. You can then use Schema Compare between database projects or deployed databases. In the example image I have compared two dev servers, and after selecting a Procedure that has a detected difference, I can inspect what has changed. You can script out the update and inspect or edit it or simply push the change to the target server. You could also import either into a database project and put it under source control.

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.