DiffPackage function (automation interface)
Syntax:
Set objMM = CreateObject("Studio.ModelManager")
Call objMM.DiffPackage ("<source model reference>", "<package id>", <diff type>, "<target model reference>", "<target folder>", "<report path and file name>", <close differencer>)
Where:
<source model reference> specifies the Reference property of the model in which the source Package resides, as displayed on the General tab of the model's property pages. The case of the reference must be correct.
<package id> specifies the id of the Package that is being differenced. When the diff type is set to 1 or 2, the package id can be the id of the model.
<diff type> specifies the type of difference that is being performed:
1. specifies that the Package is differenced against a Package in CM. When set to 1, the target model reference and target folder are ignored.
2. specifies that the Package is differenced against an exported Package in a folder. When set to 2, the target model reference is ignored.
3. specifies that the Package is differenced against the same Package in a different model. When set to 3, the target folder is ignored.
<target model reference> specifies the Reference property of the model in which the target Package resides, as displayed on the General tab of the model's property pages. Only Packages that have the same id can be differenced. The case of the reference must be correct. The target model reference is used only when the diff type is set to 3.
<target folder> specifies the folder in which the package export file resides. The target folder is used only when the diff type is set to 2.
<report path and file name> specifies the path and file name for the XML difference report.
<close differencer> specifies whether Model Differencer remains open after the XML difference report is generated. TRUE means that Model Differencer is closed after the XML report is generated, FALSE means Model Differencer remains open after the XML report is generated.
The DiffPackage function generates package XML difference reports through Model Differencer. You can optionally leave Model Differencer open after generating the difference report.
This function returns -1 if any errors are encountered, or the number of differences encountered if there are no errors.
Note that you can use the DiffModel function to compare a Model with another Model.
Examples
In this example, The Package identified by its id (d2f16...) in version 2 of Model One is differenced against the same Package in version 3 of Model Two. The report is generated to a file named DiffResult.xml. Model Differencer is closed after the report is generated.
Set objMM = CreateObject("Studio.ModelManager")
Call objMM.DiffPackage ("\\SQL\My Database\My Models\Model One\2", "d2f16029-8885-4a44-91f6-338ca0880254", 3, "\\SQL\My Database\My Models\Model Two\3", "", "c:\junk\DiffResult.xml", TRUE)
Was this helpful?