Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to identify difference between two databases' Programmability changes?

Posted on 2013-01-23
6
Medium Priority
?
453 Views
Last Modified: 2013-01-30
I've existing DB called A. I created another DB called B from the backup of A.

I do modification in both databases. Say for example, in database A, an SP has been updated. In database B, a new trigger and user defined function has been created.

I would like to know the Programmability  changes such as difference between SPs, Triggers, UDFs, How to identify them? Is there any FREE tool existing for that? Or any other way existing to identify this? Or If I want to implement new tool what approach I've to follow?

Please do guide me.

Note: I'm using SQL SERVER 2008 R2.
0
Comment
Question by:Easwaran Paramasivam
  • 3
  • 2
6 Comments
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 1000 total points
ID: 38813306
you could compare the contents of the syscomments table, which contains the text of every programability object in the database (include SPs, functions, and triggers). If you can match a row on name, but the text doesn't match, or if you have a row in one with no match in the other, then those are pieces of code that are not in sync between the two different sources.

If you have Visual Studio 2008 Professional or newer, you can use the data tools to do a schema compare between two databases, which includes code behind those objects. The advantage here is that you'd be able to generate a script to sync the two databases, instead of having to make the corrections by hand. While the data tools are free, they require a license for VS Pro, which isn't free at all.

Another option, though I've never used it, is SQLDBDiff (http://sqldbtools.com/Tools.aspx?ProductId=1). The free version of their tool lets you compare database schemas and generate a script to synchronize them, and the premium version also lets you compare the data in the tables.
0
 
LVL 15

Assisted Solution

by:Aaron Shilo
Aaron Shilo earned 1000 total points
ID: 38813318
0
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 38813325
Red Gate's SQL Compare is awesome (as are pretty much all of Red Gate's tools, honestly), but it's about $300. Well worth it, I think, but definitely not free. If you're a professional DBA at even a mid-size company, though, I'd strongly encourage you to check out their toolbelt.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38813769
@ryanmccauley: I've Visual Studio 2008 Professional edition. Please do explain me how to use data tools to do a schema compare between two databases?
0
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 38815248
This might be my mistake - I thought the Database Edition tools were an add-on to the professional edition, but apparently there's a database edition of the actual product that you might need to purchase:

http://msdn.microsoft.com/en-us/library/dd819149(v=vs.90).aspx

Given that, it looks like the free SQLDBDiff link I posted earlier might be your best bet (unless you happen to own Visual Studio Team Suite, and so have free access to the Database Edition of the product).
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 38838539
Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question