SQL Server Developer Center > SQL Server Forums > SQL Server Analysis Services > calling a stored procedure from a dimension named query
Ask a questionAsk a question
 

Answercalling a stored procedure from a dimension named query

Answers

  • Saturday, November 07, 2009 12:00 AMDarren GosbellMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You can't call stored procs from the DSV. You are pretty much restricted to a similar sub-set of SQL that you can use inside a view.

    If you can put your logic inside a function that returns a table you could call that from the DSV. If you still need your stored proc for use elsewhere then you could replace the body of your stored proc with a call to select from the function to keep your logic centralized.

    Or you could just stage the data as suggested by Mr.QuestionMark 
    http://geekswithblogs.net/darrengosbell - please mark correct answers
    • Marked As Answer byCengoGS Saturday, November 07, 2009 1:49 AM
    •  

All Replies

  • Friday, November 06, 2009 8:46 PMMr.QuestionMark Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I always create a ssis package to refresh my cube. In this way, you can create a physical dimension table and refresh this table through a component of ssis package such as Data Flow Task. And then rebuild your cube or update this dimension only.
    :)
  • Saturday, November 07, 2009 12:00 AMDarren GosbellMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You can't call stored procs from the DSV. You are pretty much restricted to a similar sub-set of SQL that you can use inside a view.

    If you can put your logic inside a function that returns a table you could call that from the DSV. If you still need your stored proc for use elsewhere then you could replace the body of your stored proc with a call to select from the function to keep your logic centralized.

    Or you could just stage the data as suggested by Mr.QuestionMark 
    http://geekswithblogs.net/darrengosbell - please mark correct answers
    • Marked As Answer byCengoGS Saturday, November 07, 2009 1:49 AM
    •