dbTalk Databases Forums  

Reordering attributes with AMO or XMLA

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


Discuss Reordering attributes with AMO or XMLA in the microsoft.public.sqlserver.olap forum.



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

Default Reordering attributes with AMO or XMLA - 10-12-2006 , 05:31 PM






I'd like to programmatically reorder the Attributes in my dimensions. I can
accomplish this manually by choosing View Code in the BI Studio as I believe
it sends the "raw" Dimension XML definition to the server.

Using AMO I tried the following:

//...connect to the server and database...
Dimension d = db.Dimensions.FindByName("Time");
d.Attributes.Move(0, 1);
d.Update(UpdateOptions.ExpandFull);

I can see the Attributes being reordered (through d.Attributes[0].Name dumps
to the console window) so the operation is legal locally. But I get the
exceptions:

Errors in the metadata manager. The cube with the ID of 'Capital View', Name
of 'Capital Cube' was invalidated by operations in the transaction.
Errors in the metadata manager. The measure group with the ID of 'Capital',
Name of 'Capital' was invalidated by operations in the transaction.
Errors in the metadata manager. The transaction cannot be committed because
one or more objects were invalidated during the transaction.

If I try to use Script Dimension as... ALTER To.. in the SQL Management
Studio and copy/paste the the <Attribute> element into the new location, I
get the same error.

Is there something special I need to do or call to get this to work? Some
kind of "don't worry I'll reprocess next" property or method? I'm pretty new
to AMO to any tips would be helpful.

-zoltan


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.