Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6244969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:25:25+00:00 2026-05-24T12:25:25+00:00

We have a set of SSAS 2005 databases that are maintained by various employees.

  • 0

We have a set of SSAS 2005 databases that are maintained by various employees. The metadata/schema including format strings, etc. have evolved to represent a significant amount of work and they change periodically. We’ve tried having the business intelligence projects under source control, but it would also be nice to have a nightly backup of all SSAS metadata, without the data itself. (The data is of course huge and reproducible, whereas the schema is tiny.)

I can programmatically (C#) loop through all the SSAS dbs easily with the Microsoft.AnalysisServices.Server.Databases collection, but I haven’t found a simple way to back up the schema without the data. Using SSMS, I can right-click the db and choose [Script Database as]–>[CREATE To]–>[File …] for example and get XMLA representing the entire database metadata. This is referenced here: http://msdn.microsoft.com/en-us/library/ms174589.aspx, and I believe this has all the information we’d like to back up… however I haven’t found methods providing similar functionality in the Microsoft.AnalysisServices assembly and am not sure where else to look.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:25:26+00:00Added an answer on May 24, 2026 at 12:25 pm

    I know I may be kind of late, but here it goes..

    This is PowerShell, but converting to C# is a breeze:

    $svrName = "localhost\sql08"
    $sourceDB = "Adventure Works DW 2008"
    $sourceCube = "Adventure Works"
    
    # load the AMO library (redirect to null to 'eat' the output from assembly loading process)
    [System.Reflection.Assembly]::LoadwithpartialName("Microsoft.AnalysisServices") > $null
    # connect to the AS Server
    $svr = New-Object Microsoft.AnalysisServices.Server
    $svr.Connect($svrName)
    
    # get a reference to the database
    $db= $svr.Databases.Item($sourceDB)
    # get a reference to the cube
    $cub = $db.Cubes.FindByName($sourceCube)
    
    # setup the scripter object
    $sb = new-Object System.Text.StringBuilder
    $sw = new-Object System.IO.StringWriter($sb)
    $xmlOut = New-Object System.Xml.XmlTextWriter($sw) 
    $xmlOut.Formatting = [System.Xml.Formatting]::Indented
    $scr = New-Object Microsoft.AnalysisServices.Scripter
    
    # create an array of MajorObjects to pass to the scripter
    $x = [Microsoft.AnalysisServices.MajorObject[]] @($cub)
    
    $scr.ScriptCreate($x,$xmlOut,$false)
    
    $sb.ToString() > c:\data\tmpCube2.xmla
    
    # clean up any disposeable objects
    $sw.Close()
    $svr.Disconnect()
    $svr.Dispose()
    

    It’s not mine, I found it here where Darren Gosbell posted it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up a site that is correctly using basic CRUD functionality succesfully.
I have set up a UITableView with 3 sections that pulls from 3 NSArrays
I have set up a little snippet that will take an autoresponder code for
I have a SSAS cube in which there is a measure that needs to
I have set the locale and timezone but when I format the date, I
I have set up a WCF service that will accept both JSON and XML
I have set up a Django application that uses images. I think I have
I have set up some code to pull up MFMailComposeViewController so that users of
I have set up multiple targets in a single xml file. I expect all
I have set up 2 servers which are linked. From my LOCAL SERVER, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.