简体   繁体   中英

SQL Command from Variable for MDX OLEDB source SSIS

I'm having some issues with an MDX query source in an SSIS data flow.

If I configure an OLEDB source properly, and have the data access mode as SQL Command, the MDX query works.

I need this source to be parameterized though, so I'm trying to pass in a variable that is populated at runtime as the MDX source query.

The problem is, when I set this up, it will try to use the variable (which is not correct until runtime) and throw this error.

What is the trick to getting an MDX Source to work from a variable?

I built all of the downstream transformations after first configuring the source with a hardcoded query (SQL Command). Then I went back to change the source to use the variable and it broke.

Thanks for any input.

TITLE: Microsoft Visual Studio
------------------------------

The component reported the following warnings:

Error at DFT SSAS to SQL [SRC SSASPRP01 Cube [2]]: No column information was returned by the SQL command.


Choose OK if you want to continue with the operation.
Choose Cancel if you want to stop the operation.

------------------------------
BUTTONS:

OK
Cancel
------------------------------

You want to a parameterized query and would like to build a String variable with the query. Anyway, your package needs to be validated before run. So, here you have two options:

  • If your query variable is populated at runtime and it has no Expressions, you might specify this variable value with a valid MDX query. The package and your DataFlow task will be validated before run (regular process)with this default query and pass, and at runtime - use correct MDX query.
  • You can set DelayValidation property of your DataFlow task to true . Then it will be validated immediately before running, when your variable will contain valid MDX query.

I would prefer the second method as more generic.

Set Delay Validation = True. Delay validation is a property available for all SSIS components and it basicly holds the validation back till excution. Mostly when we set connections or other components with variables it helps. As the variables dont have the true property at run time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM