comper two snap files in sdk

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

comper two snap files in sdk

Postby yacov » Thu Oct 06, 2011 5:25 pm

hi
i want to compare two snap files ,get result in script
like the command line comparison
"SQLCompare.exe" /sn1:D:\\bcp\\HASTRSQL.HashSQL.snp /sn2:D:\\bcp\\YACOVR_SQLHASHAVIT.HashSQL.snp /f /q /sf:tst1.sql"


In sdk
i have load the files
CustomerDB.LoadFromDisk(@"D:\\bcp\\YACOVR_SQLHASHAVIT.HashSQL.snp");
HashavimProductionDB.LoadFromDisk(@"D:\\bcp\\HASTRSQL.HashSQL.snp");


i do
Differences stagingVsProduction = HashavimProductionDB.CompareWith(CustomerDB, Options.EnableDeployNow);

how to get the script
Regards
yacov -R
yacov
 
Posts: 11
Joined: Tue Jun 29, 2010 4:46 pm

Postby Chris.Allen » Fri Oct 07, 2011 9:57 pm

I need to do a little bit of research myself to find you the full answer but let me point you in the right direction for now:


http://help.red-gate.com/help/SQLCompar ... /index.htm

for:
SQL Compare API 8.0.0

the Work.ScriptObject Method

Namespace: RedGate.SQLCompare.Engine
Assembly: RedGate.SQLCompare.Engine (in RedGate.SQLCompare.Engine.dll)


Returns the script necessary to create a SQL object.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

comper two snap files in sdk

Postby yacov » Sat Oct 08, 2011 6:46 pm

Do you have sample ?

i am using this RedGate.SQLCompare.Engine.dll.
if you using command line compare.exe like "SQLCompare.exe" /sn1:D:\\bcp\\HASTRSQL.HashSQL.snp /sn2:D:\\bcp\\YACOVR_SQLHASHAVIT.HashSQL.snp /f /q /sf:tst1.sql"

you get reuslt file that contain the difference between two snp files

i want to build comper between two snp files with sdk
after loading the files snp , how i get the diferece of the objets

thank you
Regards
yacov -R
yacov
 
Posts: 11
Joined: Tue Jun 29, 2010 4:46 pm

Postby Chris.Allen » Mon Oct 10, 2011 10:25 pm

You can find all our samples within the SDK.
I believe the answer is that the script generated by the code is written to standard out (the screen) - to redirect to a file simply use the redirection operator '>' and specify a file name.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Chris.Allen » Mon Oct 10, 2011 10:33 pm

Take a look at this example supplied in the SDK:

LoadAndSaveASnapshotExample.cs
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest