execute sql task parameter insert into
I have this in the execute sql task
Insert into tableA (Id, Name)
select ?, Name from TableB where requestID=?
Now the first parameter is from a variable and parequestID is second parameter from another variable.
how do i achieve this? Could somebody please answerThanks
July 22nd, 2011 3:15pm
you should go to parameter mappings tab,
and set each variable to parameters
parameter name should be index zero based,
this means first parameter name should be 0 , and second should be 1http://www.rad.pasfu.com
My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 3:30pm
rt click execute sql task, go to parameter mapping, under variable name drop down and chose your relevent variable , set direction to input and parameter name to 0, add another parmeter (if parequestID is already a variable you have created )
choose parequestID set diirection input and parameter name to 1. click ok and run it.
July 22nd, 2011 3:37pm
Insert into tableA (Id, Name)
select ?, Name from TableB where requestID=?
the first parameter is not there in TableB and still i can pass a parameter
What i mean to say is, there is no ID in table B. I would have to pass ID as a parameter which comes from a different source
Is that fine?Thanks
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 3:38pm
You can design it better,
you probably have a data stream which have an ID and other fields, let's name it as source1,
also you have a request ID which you want to looks for it in tableB, so you can use a merge join transform and join information form tableB with source1 on request id, and then you have data as you want as result of join , just you should use an oledb destination
and load them into tableA. all of these can be done in data flow taskhttp://www.rad.pasfu.com
My Submitted sessions at sqlbits.com
July 22nd, 2011 3:47pm
does your source table and dest table belong to same databse?
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 3:54pm
@dilipkumar1
they belong to different Servers all together
One is one Server A database A and other is another server B database BThanks
July 22nd, 2011 3:58pm
should follow reza's approch
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 4:17pm