What are the challenges you face when working across database platforms? Take the survey
Options

comper two snap files in sdk

yacovyacov Posts: 15 Bronze 2
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

Comments

  • Options
    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.
  • Options
    yacovyacov Posts: 15 Bronze 2
    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
  • Options
    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.
  • Options
    Take a look at this example supplied in the SDK:

    LoadAndSaveASnapshotExample.cs
Sign In or Register to comment.