Customization > Automation Interface > Functions > For Models > RenameModel function (automation interface)
RenameModel function (automation interface)
Syntax:
RenameModel (\\SQL\<server>@<instance>\<database>\<model>\<version>", "<new model name>")
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 rename. The case of the name must be correct.
<model> is a string that specifies the name of the Model you want to rename. The case of the name must be correct.
<version> is a string that specifies the version of the Model you want to export. If the Model has not been versioned, the version is 0.
<new model name> is a string that specifies the name of the new model.
The RenameModel function renames a model.
This function returns the reference of the renamed model.
Examples
This example changes the name of a model named MyModel in the MyDatabase database to My New Model Name.
Set objManager = CreateObject("Studio.ModelManager")
objManager.RenameModel("\\SQL\MyServer@MODELER\MyDatabase\MyModel\0","My New Model Name")