Wednesday, March 7, 2012

Context Class in AS 2005 Stored Procedure

We are trying to use the CurrentTuple property of the Context Class available in the assembly Microsoft.AnalysisServices.AdomdServer. The CurrentTuple property is documented in the standard AS2005 doc (see http://msdn2.microsoft.com/en-US/library/ms175329.aspx). However this seems not available in the class definition. The only property available are

public static CultureInfo ClientCultureInfo

public static CubeCollection Cubes

public static CubeDef CurrentCube

public static string CurrentDatabaseName

public static MiningModel CurrentMiningModel

public static string CurrentServerID

public static bool ExecuteForPrepare

public static MiningModelCollection MiningModels

public static MiningServiceCollection MiningServices

public static MiningStructureCollection MiningStructures

public static int Pass

Any suggestion?

Thanks a lot.

Riccardo

Hi Riccardo,

Looks like there are inconsistencies in BOL documentation - the link below doesn't list CurrentTuple. But this entry in Chris Webb's blog may help - it shows how to find the current member on each attribute hierarchy of the CurrentCube:

http://spaces.msn.com/cwebbbi/blog/cns!7B84B0F2C239489A!586.entry

>>

The first problem I tried to solve was this: how do you return the name of the currentmember on all dimensions in your cube in a query?

>>

http://msdn2.microsoft.com/en-us/library/microsoft.analysisservices.adomdserver.context_members.aspx

>>

Context Members

Provides the execution context for the stored procedure.

The following tables list the members exposed by the Context type.

Public Properties

Name Description ClientCultureInfo Gets the culture for the current client. Cubes Gets a collection of cubes that are available in the current database or context. CurrentCube Gets the current cube. CurrentDatabaseName Gets the current database name for the current session. CurrentMiningModel Gets the current mining model. CurrentServerID Gets the server identifier (server\instance) for the current session. ExecuteForPrepare Gets a value that indicates whether the stored procedure is being called for preparation purposes. MiningModels Gets the mining models in the current database. MiningServices Gets the mining services in the current database. MiningStructures Gets the mining structures in the current database. Pass

Gets the pass number that the user-defined function (UDF) or stored procedure is running under.

>>

|||

Thanks a lot, Deepak.

Riccardo

No comments:

Post a Comment