Customization > Automation Interface > Functions > For Models > VersionModel function (automation interface)
VersionModel function (automation interface)
Syntax:
VersionModel (\\SQL\<server>@<instance>\<database>\<model>\<version>")
Where:
<server> is a string that specifies the name of the server on which the Database resides. The case of the name must be correct.
<database> is a string that specifies the name of the Database that owns the Model you want to version. The case of the name must be correct.
<model> is a string that specifies the name of the Model you want to version. The case of the name must be correct.
<version> is a string that specifies the version of the Model you want to delete. If the Model has not been versioned, the version is 0.
The VersionModel function creates a new version of a model. You can create a new version of a model version only if that model version is the tip version of the trunk, or the tip version of a branch that has not been reconciled.
This function returns the reference of the new model version.
Examples
This example creates a new version of the MyModel version 3 model in the MyDatabase database.
Set objManager = CreateObject("Studio.ModelManager")
objManager.VersionModel("\\SQL\MyServer@MODELER\MyDatabase\MyModel\3")
Was this helpful?