dbTalk Databases Forums  

Create Partition via TSQL or other way (i.e. dynamically)

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


Discuss Create Partition via TSQL or other way (i.e. dynamically) in the microsoft.public.sqlserver.olap forum.



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

Default Create Partition via TSQL or other way (i.e. dynamically) - 01-09-2006 , 10:03 AM






Hi all,

Is there a way that I can create a partition within a cube dynamically?
For example, I want to create a partition Sales2006 and push all 2006 data
into this partition.

Is there a way that I can create this partition either via TSQL or within a
DTS package and then populate it with 2006 data?

Many thanks
Immy



Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Create Partition via TSQL or other way (i.e. dynamically) - 01-09-2006 , 11:03 AM






The underlying mechanisms is via DSO (AS2K) or AMO (AS2K5). There is no
direct TSQL equivalent. Depending on if this is AS2K or AS2K5, I'd point you
to different facilities.

For AS2K, there are lots of examples out there for creating a partitions
programmatically. Probably the easiest way (if you want to solve this by
writing a VB program), is to get a copy of the SQL 2000 Resource Kit and on
it is a utility called "Metadata Scripter". It is an addin to Analysis
Manager which allowed you to right click on a partition and then "save it as
a VB program" which called DSO to create the partition. You could use that
as a starting point for a VB program which took some info and created a
partition for you.

Second, again for AS2K, look at the DSO/XML utility
http://www.microsoft.com/downloads/d...DisplayLang=en

For AS2K5, you can something similar (but using AMO, the new management
facility). You can also do this via XMLA scripting. If you create the
partition using SQL Management Studio (SSMS), then right-click on it, you
can see that you have an option to generate a "Create" script. Since this is
just a text file, you can manipulate it anyway you wish. To execute an XMLA
script, you can either use the SSIS Execute Analysis Services DDL task
(which takes the XMLA script itself), To see how to use it, look in the
SQL2K5 Samples install for the "AdvWorksSync" sample. It creates partitions
on-the-fly sychronizing the Adventure Works DW RDBMS and AS partitions.

Or you can create a SQL Agent job (there is a new type of "step" in SQL
Agent.which is an XMLA script, just like you can add a TSQL step to a SQL
Agent job). Lastly, with the next release of the SQL2K5 Samples install ,
there will be a new command-line utility called "ASCmd" to execute an XMLA
script.

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Immy" <imtiaz_ullah (AT) hotmail (DOT) com> wrote

Quote:
Hi all,

Is there a way that I can create a partition within a cube dynamically?
For example, I want to create a partition Sales2006 and push all 2006 data
into this partition.

Is there a way that I can create this partition either via TSQL or within
a DTS package and then populate it with 2006 data?

Many thanks
Immy




Reply With Quote
  #3  
Old   
Immy
 
Posts: n/a

Default Re: Create Partition via TSQL or other way (i.e. dynamically) - 01-09-2006 , 11:12 AM



DAVE!!! You're a diamond!
Many thanks for all this information. I'm sure it's going to help me out.
Apologies for not adding my system info (I usually add that!) but it is
AS2K, but we will be moving to 2K5 very quickly.

Best Regards
Immy


"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> wrote

Quote:
The underlying mechanisms is via DSO (AS2K) or AMO (AS2K5). There is no
direct TSQL equivalent. Depending on if this is AS2K or AS2K5, I'd point
you to different facilities.

For AS2K, there are lots of examples out there for creating a partitions
programmatically. Probably the easiest way (if you want to solve this by
writing a VB program), is to get a copy of the SQL 2000 Resource Kit and
on it is a utility called "Metadata Scripter". It is an addin to Analysis
Manager which allowed you to right click on a partition and then "save it
as a VB program" which called DSO to create the partition. You could use
that as a starting point for a VB program which took some info and created
a partition for you.

Second, again for AS2K, look at the DSO/XML utility
http://www.microsoft.com/downloads/d...DisplayLang=en

For AS2K5, you can something similar (but using AMO, the new management
facility). You can also do this via XMLA scripting. If you create the
partition using SQL Management Studio (SSMS), then right-click on it, you
can see that you have an option to generate a "Create" script. Since this
is just a text file, you can manipulate it anyway you wish. To execute an
XMLA script, you can either use the SSIS Execute Analysis Services DDL
task (which takes the XMLA script itself), To see how to use it, look in
the SQL2K5 Samples install for the "AdvWorksSync" sample. It creates
partitions on-the-fly sychronizing the Adventure Works DW RDBMS and AS
partitions.

Or you can create a SQL Agent job (there is a new type of "step" in SQL
Agent.which is an XMLA script, just like you can add a TSQL step to a SQL
Agent job). Lastly, with the next release of the SQL2K5 Samples install ,
there will be a new command-line utility called "ASCmd" to execute an XMLA
script.

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.


"Immy" <imtiaz_ullah (AT) hotmail (DOT) com> wrote in message
news:ucTiIZTFGHA.2648 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi all,

Is there a way that I can create a partition within a cube dynamically?
For example, I want to create a partition Sales2006 and push all 2006
data into this partition.

Is there a way that I can create this partition either via TSQL or within
a DTS package and then populate it with 2006 data?

Many thanks
Immy






Reply With Quote
  #4  
Old   
Vimas
 
Posts: n/a

Default Re: Create Partition via TSQL or other way (i.e. dynamically) - 01-09-2006 , 09:30 PM



For SSAS check apendix A in:
http://www.microsoft.com/technet/pro.../realastd.mspx


"Immy" <imtiaz_ullah (AT) hotmail (DOT) com> wrote

Quote:
DAVE!!! You're a diamond!
Many thanks for all this information. I'm sure it's going to help me out.
Apologies for not adding my system info (I usually add that!) but it is
AS2K, but we will be moving to 2K5 very quickly.

Best Regards
Immy


"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> wrote in message
news:e38UF7TFGHA.3100 (AT) tk2msftngp13 (DOT) phx.gbl...
The underlying mechanisms is via DSO (AS2K) or AMO (AS2K5). There is no
direct TSQL equivalent. Depending on if this is AS2K or AS2K5, I'd point
you to different facilities.

For AS2K, there are lots of examples out there for creating a partitions
programmatically. Probably the easiest way (if you want to solve this by
writing a VB program), is to get a copy of the SQL 2000 Resource Kit and
on it is a utility called "Metadata Scripter". It is an addin to Analysis
Manager which allowed you to right click on a partition and then "save it
as a VB program" which called DSO to create the partition. You could use
that as a starting point for a VB program which took some info and
created a partition for you.

Second, again for AS2K, look at the DSO/XML utility
http://www.microsoft.com/downloads/d...DisplayLang=en

For AS2K5, you can something similar (but using AMO, the new management
facility). You can also do this via XMLA scripting. If you create the
partition using SQL Management Studio (SSMS), then right-click on it, you
can see that you have an option to generate a "Create" script. Since this
is just a text file, you can manipulate it anyway you wish. To execute an
XMLA script, you can either use the SSIS Execute Analysis Services DDL
task (which takes the XMLA script itself), To see how to use it, look in
the SQL2K5 Samples install for the "AdvWorksSync" sample. It creates
partitions on-the-fly sychronizing the Adventure Works DW RDBMS and AS
partitions.

Or you can create a SQL Agent job (there is a new type of "step" in SQL
Agent.which is an XMLA script, just like you can add a TSQL step to a SQL
Agent job). Lastly, with the next release of the SQL2K5 Samples install ,
there will be a new command-line utility called "ASCmd" to execute an
XMLA script.

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.


"Immy" <imtiaz_ullah (AT) hotmail (DOT) com> wrote in message
news:ucTiIZTFGHA.2648 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi all,

Is there a way that I can create a partition within a cube dynamically?
For example, I want to create a partition Sales2006 and push all 2006
data into this partition.

Is there a way that I can create this partition either via TSQL or
within a DTS package and then populate it with 2006 data?

Many thanks
Immy








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.