How to compare triggers in two different MSSQL DBs?

Aug 26, 2004
14,685
1
76
I have a database that has a few hundred triggers(many of them are a few thousand lines) in it, there were several changes that were made to the triggers to resolve certain issues. Unfortunately, the person who made the changes didn't document them and isn't around to tell me what he did. I do have a backup of the DB that contains the changes, however.

Both DBs are SQL8, I have another copy of the DB that does not contain the changes. Is there an easy way to pick out the trigger changes between the two without manually comparing each trigger line by line?

Thanks in advance!
 

KIAman

Diamond Member
Mar 7, 2001
3,342
23
81
I have a database that has a few hundred triggers(many of them are a few thousand lines) in it, there were several changes that were made to the triggers to resolve certain issues. Unfortunately, the person who made the changes didn't document them and isn't around to tell me what he did. I do have a backup of the DB that contains the changes, however.

Both DBs are SQL8, I have another copy of the DB that does not contain the changes. Is there an easy way to pick out the trigger changes between the two without manually comparing each trigger line by line?

Thanks in advance!

Run them through a diff editor. I like Winmerge. This will show the textual differences. It won't show you how functionality has changed, that is up to your interpretation.
 

LokutusofBorg

Golden Member
Mar 20, 2001
1,065
0
76
RedGate has tools that can do it from the databases. I'm sure there are others (KLin's link? didn't follow it myself, sorry...)

Otherwise, script all the objects to file and use your file compare tool of choice.
 

KLin

Lifer
Feb 29, 2000
30,134
506
126
I just tried the one that I linked to and it worked fine. I only had a couple columns that were not in one copy that I had. it generated a script to create the columns.