PRB: Unable to Set SourceTable Property of Partitions to a Different Source Table (299930)



The information in this article applies to:

  • Microsoft SQL Server OLAP Services 7.0

This article was previously published under Q299930

SYMPTOMS

When you programmatically set the SourceTable property for a partition to a source table different than that used by the parent cube, the SourceTable property of the partition remains set to the SourceTable property of the parent cube.

CAUSE

When you set the SourceTable property for a partition programmatically, the SourceTable property remains set to the SourceTable property of the parent cube, until both the SourceTable and the FromClause property of the partition are set.

WORKAROUND

When you programmatically create partitions that use a different source table than the cube, set both the SourceTable and FromClause properties of the partition.

MORE INFORMATION

The SourceTable property of the partition remains set to the SourceTable property of the parent cube until the FromClause property of the partition is set. To make sure that the data for the partitions are properly processed, you must also set the JoinClause property of the partition.

Steps to Reproduce Behavior

  1. Open the DSOSample Microsoft Visual Basic project in the Program Files\Microsoft Analysis Services\Samples\VBDSOExample folder.
  2. Execute the application, type in the server name, and then click Create 'Sales' Cube to create the Sales cube.
  3. After the Sales cube is created, click Create Advanced Features.
  4. After advanced features completes, open Analysis Manager, and then expand the DSOSample database.
  5. Navigate to the Sales 1997 partition, and then edit the partition.
  6. Note the name of the Fact table used by the partition is Sales_fact_1998, although the code in the application specifies Sales_fact_1997.
  7. Open the CreatePartition method in the AdvancedSampleCode module of the DSOSample Visual Basic project.
  8. Change the following lines of code from:
        ' set the partition's FromClause and JoinClause
        dsoPartition.FromClause = StringReplace(m_dsoCube.FromClause, _
                                                m_dsoCube.SourceTable, _
                                                dsoPartition.SourceTable)
        
        dsoPartition.JoinClause = StringReplace(m_dsoCube.JoinClause, _
                                                m_dsoCube.SourceTable, _
                                                dsoPartition.SourceTable)
    
    					
    to:
        Dim newSource As String
        newSource = "Sales_fact_1997"
    
        ' set the partition's FromClause and JoinClause
        dsoPartition.FromClause = StringReplace(m_dsoCube.FromClause, _
                                                m_dsoCube.SourceTable, _
                                                newSource)
        
        dsoPartition.JoinClause = StringReplace(m_dsoCube.JoinClause, _
                                                m_dsoCube.SourceTable, _
                                                newSource)
    
    					
  9. Execute the updated application.
  10. Open Analysis Manager and refresh the server.
  11. Expand the DSOSample database.
  12. Navigate to the Sales 1997 partition, and then edit the partition.
  13. Note that the name of the Fact table used by the partition is now listed as Sales_fact_1997.

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbprb KB299930