sql server - SSIS OLEDB data transfer calling parametereized stored procedure | Columns not found -


i have sql server stored procedure takes parameter part of database name. works when executing sql server management studio.

however need call sp ssis ole db source component. when specify sql command , parameters in ole db source component, following error:

"error @ ssis error code dts_e_oledberror. ole db error has occurred. error code: 0x80004005. ole db record available. source: "microsoft sql server native client 10.0" hresult: 0x80004005 description: "the ole db provider "sqlncli10" linked server not contain table table either not exist or current user not have permissions on table.".: unable retrieve column information data source. make sure target table in database available".

basically cant find table used stored procedure database name parameterized. searched around , found ole db data source needs meta data table. how can provide this?

this stored procedure:

use [illp] go  set ansi_nulls on go set quoted_identifier on go   alter procedure [dbo].[output_mi_tyep12] @param1 varchar(5) begin     set fmtonly off;    set nocount on;  declare @query varchar(1000)  set @query=' select [m12]       ,[t3size]       ,[sizevcost]       ,null [defaulttonnage]       ,null [idlecost]       ,null [superlocoid]       ,[ifallowfleetsizevio]   [servn\prod2].[scenario_' + @param1 +'_prd].[dbo].[para_ltype]'  exec(@query) end 

i guessing trying loop through different databases using sp parameter in ssis. select command variable source:

  1. create new variable - select_output_mi_tyep12 instance (string type);
  2. within variable properties check evaluateasexpression = true;
  3. under expression use following:

    select [m12]       ,[t3size]       ,[sizevcost]       ,null [defaulttonnage]       ,null [idlecost]       ,null [superlocoid]       ,[ifallowfleetsizevio]  [servn\\prod2].[scenario_" + @[user::dbnameparameter]  + "_prd].[dbo].[para_ltype] 
  4. change @[user::dbnameparameter] specific one;

  5. use sql command variable in connection manager, selecting select_output_mi_tyep12 variable.

this should allow gather meta data table , carry on rest of data flow.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -