viewing/comparing SQL code in difference
fordc03
Posts: 49 Bronze 2
okay, since I've been tasked with re-inventing the wheel...
I've got a collection of differences...now, in my windows app, since SQLcompare only does 1 database at a time and I have a need to do a server at a time...I have it grouped by databases, then by differences...
basically, I have a baseline database and need to compare that baseline with about 500 other databases on a server to verify they're the same.
Well, like in SQLCompare, I kind of need the ability to select a row or difference and have it display the SQL code from both...I'll have to figure out a highlighting option later...right now...I just wanna know the best way to "select" the T-SQL code from Obect1 and Object2...
Am I making sense?
I've got a collection of differences...now, in my windows app, since SQLcompare only does 1 database at a time and I have a need to do a server at a time...I have it grouped by databases, then by differences...
basically, I have a baseline database and need to compare that baseline with about 500 other databases on a server to verify they're the same.
Well, like in SQLCompare, I kind of need the ability to select a row or difference and have it display the SQL code from both...I'll have to figure out a highlighting option later...right now...I just wanna know the best way to "select" the T-SQL code from Obect1 and Object2...
Am I making sense?
Comments
what I am not sure how to do is select the code of the difference or if it's available even.
Sorry about the delay in this response.
You can use the reporting functionality of the SQL Compare GUI for exporting results as HTML. This report would contain the SQL from both objects in a split panel.
If this sounds like the sort of thing you are trying to achieve, you could send me a private email and I can send you an example C# Project to create HTML reports with SQL Toolkit.
I posted this before I read that I could email support for an example.
Thanks for letting me know.
I didn't want to start a new topic on the forum since I think this could be the thing I am looking for.
I am using SQL Toolkit API and writing an application which compares and sync's two databases, everything works fine but how can I create some kind of pane with SQL Differences so when I select the difference which is found between two db's I see how the SQL differs in the two instances in a text box or something like that?
Thank you
You should be able to modify the below example to fit your needs, but this will write out the differences to an XML file.
I will drop a view on the code you provided but as you said using of regions is what solves the problem...I found this among the posts
for(int i = 0; i <= obDatabaseDifferences.Count-1; i++)
{
Difference diff = (Difference)obDatabaseDifferences;
Work w = new Work();
Regions regions1 = w.ScriptObject(diff.ObjectIn1, enOptions);
Regions regions2 = w.ScriptObject(diff.ObjectIn2, enOptions);
}
and this is doing the job I want, I think :?
thanks..