Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server 2019 and earlier Analysis Services
Azure Analysis Services
Fabric/Power BI Premium
Important
Data mining was deprecated in SQL Server 2017 Analysis Services and now discontinued in SQL Server 2022 Analysis Services. Documentation is not updated for deprecated and discontinued features. To learn more, see Analysis Services backward compatibility.
In addition to the functionality provided in SQL Server Analysis Services for backing up, restoring, and migrating solutions, SQL Server Data Mining provides the ability to quickly transfer data mining structures and models between different servers by using Data Mining Extensions (DMX).
If your data mining solution uses relational data instead of a multidimensional database, transferring models by using EXPORT and IMPORT is much faster and easier than either using database restore or deploying an entire solution.
This section provides an overview of how to transfer data mining structures and models by using DMX statements. For syntax details and examples, see EXPORT (DMX) and IMPORT (DMX).
Note
You must be a database or server administrator to export or import objects from a Microsoft SQL Server Analysis Services database.
Exporting data mining structures
When you export a mining structure, the EXPORT statement automatically exports all associated models. To control which objects are exported, you must specify each object by name.
If the mining structure is processed and the results are cached, which is the default behavior, the exported mining structure definition contains a summary of the data the structure is based on. To remove this summary, you must clear the cache associated with the mining structure by performing a Process Clear Structure operation. For more information, see Process a Mining Structure.
Exporting data mining models
Use the WITH DEPENDENCIES keyword to export the data source and data source view definition along with the mining model and its structure.
When you export a mining model without exporting its dependencies, the EXPORT statement exports the definition of the mining model and its mining structure, but doesn't export the definition of the data sources. Therefore, you can browse the model immediately after you import the model, but to reprocess the mining model on the target server, or run queries against the underlying data, you must create a corresponding data source on the destination server.
Importing data mining structures and models
When you import a data mining object, the object imports to the server and database you're connected to when you execute the IMPORT statement. If the import file includes a database that doesn't exist on the server, the database is created.
You can also import a mining structure or mining model by using the Restore command. Your models or structures restore into the database that has the same name as the database they were exported from. For more information, see Restore options.
Remarks
You can't import a model or structure to a server that already has a model or structure with the same name. You also can't rename a data mining object in an export file. To avoid naming conflicts, either delete the original data mining object on the target server or rename the data mining object before you export the definition.