how to call stored procedure from SSIS? -


i want create ssis package call stored procedure , dump output of procedure table.

ssis package return output , need resultset ouput dump table. before inserting want update rows tables if rows exist date or insert resultset.

i do't quite understand requirements way:

  1. drop on execute sql task

  2. ensure yourstagingtable exists , columns match stored procedure output

here sample code put in execute sql task want:

-- clear staging table truncate yourstagingtable  -- save results of stored proc staging table insert yourstagingtable exec yourproc  -- update existing records update yourfinaltable set yourupdatefield = yourstagingtable.yoursourcefield yourstagingtable yourfinaltable.joinfield1 = yourstagingtable.joinfield1  -- insert non existing records insert yourfinaltable (column1,column2) select column1,column2 yourstagingtable not exists (     select 1 yourfinaltable      yourfinaltable.joinfield1 = yourstagingtable.joinfield1     ) 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -