0

I'am trying to combine SQL and MDX data on SQL Server Reporting Services.

I found a solution about the sp_addlinkedserver.

Exec sp_addlinkserver
   @server = 'localhost'
   @srvproduct = ''
   @provider = 'MSOLAP'
   @datasrc = 'localhost\instancename'
   @catalog = 'Databasename'

My problem in the above code was that the value of @server, @datasrc and @catalog is dynamic. Sometimes, SQL Server database and Olap cube are on a different machines and different instance names based on the choice of a customer how it will be deployed.

I want to create an SSRS report where it can pass the parameter for the @server, @datasrc and @catalog based on the "SSRS datasource" it is using. This parameters will be forwarded on the SQL Server stored procedure which will somewhat look like the code below

Exec sp_addlinkserver
  @server = @servername_of_the_olap_database
  @srvproduct = ''
  @provider = 'MSOLAP'
  @datasrc = @datasource_of_the_olap_database
  @catalog = @olap_database

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
ggarcia
  • 47
  • 1
  • 10
  • Welcome to StackOverflow: if you post code, XML or data samples, **please** highlight those lines in the text editor and click on the "code samples" button ( `{ }` ) on the editor toolbar to nicely format and syntax highlight it! THat way, you don't need any of those messy `
    ` tags, either!
    – marc_s Oct 12 '12 at 12:22
  • 1
    thanks marc_s, I will be doing that next time :) – ggarcia Oct 12 '12 at 12:33

0 Answers0