How to identify difference between two databases' Programmability changes?

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.
LVL 16
Easwaran ParamasivamAsked:
Who is Participating?
Ryan McCauleyConnect With a Mentor Data and Analytics ManagerCommented:
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 ( 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.
Aaron ShiloConnect With a Mentor Chief Database ArchitectCommented:
Ryan McCauleyData and Analytics ManagerCommented:
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.
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Easwaran ParamasivamAuthor Commented:
@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?
Ryan McCauleyData and Analytics ManagerCommented:
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:

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).
Easwaran ParamasivamAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.