This article explains How to Attach Analysis Services Database in SQL Server. The steps mentioned in this article are applicable on SQL Server 2008 and Higher Versions.
Different ways in which an Analysis Services (SSAS) Database
- Using SQL Server Management Studio
- Using XMLA Scripts
- Programmatically Using Analysis Management Objects (AMO)
However, in this article we will take a look at attaching the analysis services database using SQL Server Management Studio and by Using XMLA Script.
To Detach an Analysis Services Database refer the following article “How to Detach SSAS Database in SQL Server”
Attach Analysis Services Database / Attach SSAS Database Using SQL Server Management Studio
Step 1. Connect to Analysis Services Instance Using SQL Server Management Studio
Step 2. Right click Databases and then choose Attach… from the popup to open up Attach Database Dialog box.

Trending Analysis Services Articles and Tips
- How to Detach SSAS Database in SQL Server
- How to Attach SSAS Database in SQL Server
- How to Synchronize Analysis Services Database Using Synchronize Database Wizard in SSMS
- How to Restore Analysis Services Database in SQL Server Using SQL Server Management Studio
- How to Automate Backup of Analysis Services Database Using SQL Server Agent Job
- How to Backup Analysis Services Database in SQL Server Using SQL Server Management Studio
- Database Consistency Checker DBCC CHECK For Analysis Services Database in SQL Server 2016 for Tabular and Multidimensional Databases
Step 3. In Attach Database Dialog box specify the location of OLAP database and specify the password incase if you give at the time of detaching the SSAS database and then click OK to attach the analysis services database. If you want to generate XMLA Script to Attach analysis Database then click on Script and then choose “Script Action to New Query Window” as shown in the below snippet.

XMLA Script to Attach Analysis Services Database in SQL Server 2008 and Higher Versions
<Attach xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Folder> D:\Program Files\Microsoft SQL Server\MSAS10_50.MyTechMantra\OLAP\Data\MyTechMantra.0.db\</Folder> <ReadWriteMode xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100">ReadWrite</ReadWriteMode>
</Attach>
Conclusion
In this article you have seen different methods in which one can attach an Analysis Services (SSAS) database in SQL Server 2008 and higher versions.
Add comment