Share via


EXPORT (DMX)

Extracts a mining model or mining structure object from the server to an Analysis Services backup file.

Syntax

EXPORT <object type> <object name>[, <object name>] [<object type> <object name>[, <object name] ] TO <filename> [WITH DEPENDENCIES, PASSWORD = '<password>']

Arguments

  • object type
    The type of the object to export.

    Value

    Description

    MINING MODEL

    Exports the mining model together with its underlying mining structure.

    MINING STRUCTURE

    Exports only the mining structure.

  • object name
    The name of the object to export.

    To specify multiple object names, separate the names by commas. Enclose the object name in square brackets if the name contains spaces.

  • filename
    A string that specifies the path and name of the file that stores the exported definition.

  • WITH DEPENDENCIES
    Indicates that all objects required to process the object should also included in the backup file. For example, dependencies might include the data source and data source view used to create the object.

  • PASSWORD
    Indicates that the backup file should be password-protected.

  • password
    A string that specifies the password for accessing the object in the backup file.

Remarks

You must be a database or server administrator to export or import data mining objects.

For backward compatibility, the default filename extension for the backup file is .abf; however, you can use any filename extension that you want. Note, however, that the format of the file is internal to Analysis Services, and the file cannot be read or edited regardless of which extension you use.

OLAP mining models have complex dependencies and cannot be exported by using the EXPORT command.

Example 1: Export Mining Structure

The following example exports the Targeted Mailing and Forecasting mining structures, together with the Association mining model, to a specific file location. Because the Association model is part of the Market Basket mining structure, the example also exports the Market Basket structure. Any other mining models that may exist as part of the Market Basket mining structure will not be exported because the Association model was exported using the keyword MINING MODEL.

EXPORT MINING STRUCTURE [Targeted Mailing], [Forecasting] MINING MODEL Association TO 'C:\TM_NEW.abf'

Example 2: Export Mining Model

The following example exports the Association mining model to a specified file location. Because the statement uses the keyword, WITH DEPENDENCIES, the data source and data source view objects are also included in the backup file.

EXPORT MINING MODEL [Association] TO 'C:\Association_NEW.abf' WITH DEPENDENCIES

Example 3: Export Protected Mining Model

The following example exports the Call Center mining model to the specified file location, and uses a password to protect the model. Because the statement uses the keyword, PASSWORD, you must supply the specified password when you import the backup file or the model cannot be created.

EXPORT MINING MODEL [Call Center_LR]
    TO 'C:\Temp\ExportedModels\CallCenterPrediction.abf' 
    WITH DEPENDENCIES, PASSWORD='CCLR2%'

Change History

Updated content

Added short explanation of backup files. Noted that OLAP models cannot be exported by using DMX.

Added list of arguments. Added keywords to arguments table.

Provided new example of password usage. Added numbering to examples.