Red Gate forums :: View topic - comper two snap files in sdk
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

comper two snap files in sdk

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
yacov



Joined: 29 Jun 2010
Posts: 11

PostPosted: Thu Oct 06, 2011 5:25 pm    Post subject: comper two snap files in sdk Reply with quote

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
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Fri Oct 07, 2011 9:57 pm    Post subject: Reply with quote

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/SQLCompareAPIv8/0/en/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.
Back to top
View user's profile Send private message
yacov



Joined: 29 Jun 2010
Posts: 11

PostPosted: Sat Oct 08, 2011 6:46 pm    Post subject: comper two snap files in sdk Reply with quote

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
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Mon Oct 10, 2011 10:25 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Mon Oct 10, 2011 10:33 pm    Post subject: Reply with quote

Take a look at this example supplied in the SDK:

LoadAndSaveASnapshotExample.cs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group