[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Compare two SQL database and script changes

I have two databases one in a UAT environment and one in a DEV environment.  I will like to update the UAT environment with the changes made in the DEV environment such as additional columns to existing tables, new tables and sps.

i there some method that can compare the two databases and script any changes?
0
RDLFC
Asked:
RDLFC
  • 2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
SQL Server (2012) Data Tools has SQL menu > Schema Compare > New Schema Comparison, which enables you to point to a source and target database, identify any objects that are in one and not the other / in both but different, and to 'migrate' those changes with a couple of button clicks.

Invaluable when migrating all changes from one database (say DEV) to another (UAT).

Once the compare is complete you'll be able to click the 'Generate Script' button to get a single .sql script of all changes.

>such as additional columns to existing tables, new tables and sps.
If these are the only changes, then hit the Options button (looks like a gear), and in the Object Types tab uncheck the Application-scoped node, then expand it, then check only the tables and SP's checkboxes.  That way it doesn't try to compare and potentially update all of the users, groups, views, and other stuff.
0
 
RDLFCAuthor Commented:
i am not seeing the menu options you described.  I am using server management studio 2012.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
SQL Server Data Tools is a separate download performed after SQL Server/SSMS.
0
 
Alpesh PatelAssistant ConsultantCommented:
One Free tool is DBCompare

I have been using since 2 years
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now