dbTalk Databases Forums  

OLAP Cubes and Programming

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss OLAP Cubes and Programming in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Devin McMahon
 
Posts: n/a

Default OLAP Cubes and Programming - 07-07-2003 , 01:41 PM






I have what I believe is a unique situation. I am
using SQL Server Analysis Server to build a cube of "snapshot"
month-end type of data. This data is from an instance of Microsoft
Navision and I have successfully used SQL-DMO and DTSPackage Library
objects to allow the user to rebuild the cube through Navision. This
is accounting data and as such, the accountants want to be able to
archive this data by month. I know through Analysis Server Manager
interface I can copy the cube and save it to a different name.

I would like to know if there is a way to programmatically save a cube
to a different name with some type of automation object?

Thanks

Reply With Quote
  #2  
Old   
Devin McMahon
 
Posts: n/a

Default Re: OLAP Cubes and Programming - 07-11-2003 , 08:18 AM






Thank you for your help, it is appreciated. I know where to start now

"Marin Bezic [MSFT]" <marinb (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Devin,

DSO is the object model for Analysis Services analogous to DMO for SQL
Server. Take a look at Books Online for more information.

You are in particular looking at the Clone method on the Cube object
(MDStore interface).

The (pseudo) code would look something like this in VB. Not sure if it will
compile but it should be mostly right:

Dim s as new DSO.Server
s.connect "myservername"

Dim SourceCube as DSO.MDStore
set SourceCube = s.MDStores("my database name").MDStores("my cube name")

Dim TargetServer as new DSO.Server 'only if you want to copy to another
server
TargetServer.Connect "server name"

Dim TargetDatabase as DSO.MDStore
Set TargetDatabase = TargetServer.MDStores("target database name")
' or Set TargetDatabase = s.MDStores("my database name") if you are making
copy of the cube in the same database

Dim TargetCube as DSO.MDStore
Set TargetCube = TargetDatabase.MDStores.AddNew("new cube name")

SourceCube.Clone(targetCube, cloneMajorChildren) ' this will copy all
partitions as well
' or SourceCube.Clone(targetCube, cloneMinorChildren) ' this will copy no
partitions (maybe just the default - 1st - one)
TargetCube.Update
TargetCube.Process

You will have to process the cube after cloning because DSO will just copy
the metadata

Marin Bezic

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"Devin McMahon" <dmcmaho1 (AT) twcny (DOT) rr.com> wrote in message
news:10ef789a.0307071041.2879172f (AT) posting (DOT) google.com...
I have what I believe is a unique situation. I am
using SQL Server Analysis Server to build a cube of "snapshot"
month-end type of data. This data is from an instance of Microsoft
Navision and I have successfully used SQL-DMO and DTSPackage Library
objects to allow the user to rebuild the cube through Navision. This
is accounting data and as such, the accountants want to be able to
archive this data by month. I know through Analysis Server Manager
interface I can copy the cube and save it to a different name.

I would like to know if there is a way to programmatically save a cube
to a different name with some type of automation object?

Thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.