Unable to delete role using code

  • Hi all

    I've created a test role in my multidimensional cube and I want to delete it using code.
    I scripted it as a delete using the GUI in SSMS but the code fails.
    The code the GUI generated is this:-

    <Delete xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
      <Object>
       <RoleID>Role 1</RoleID>
       <DatabaseID>DataWarehouseCubes</DatabaseID>
      </Object>
    </Delete>

    When I run it, I get the following error messages:-

    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction.  (appears several times)
    Errors in the metadata manager. The cube permission with the ID of 'CubePermission 1', Name of 'CubePermission 1' was invalidated by operations in the transaction.
    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction. (appears several times again)
    Errors in the metadata manager. The cube permission with the ID of 'CubePermission 1', Name of 'CubePermission 1' was invalidated by operations in the transaction.
    Errors in the metadata manager. The datasource permission with the ID of 'DataSourcePermission', Name of 'DataSourcePermission' was invalidated by operations in the transaction.
    Errors in the metadata manager. The database permission with the ID of 'DatabasePermission 1', Name of 'DatabasePermission 1' was invalidated by operations in the transaction.
    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction. (appears several times)
    Errors in the metadata manager. The cube permission with the ID of 'CubePermission', Name of 'CubePermission' was invalidated by operations in the transaction.
    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction.
    Errors in the metadata manager. The cube permission with the ID of 'CubePermission 1', Name of 'CubePermission 1' was invalidated by operations in the transaction.
    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction.
    Errors in the metadata manager. The cube permission with the ID of 'CubePermission 1', Name of 'CubePermission 1' was invalidated by operations in the transaction.
    Errors in the metadata manager. The dimension    permission with the ID of 'DimensionPermission', Name of 'DimensionPermission' was invalidated by operations in the transaction. (appears several times)
    Errors in the metadata manager. The transaction cannot be committed because one or more objects were invalidated during the transaction.
    Run complete

    Anyone any ideas why the role won't delete using the generated XMLA?

  • I think I've got to the bottom of it.
    It looks like you've got to delete all the permissions first and then delete the role as they don't cascade.

    Can someone confirm/correct please?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply